p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 14th, 2006, 06:36 PM
Registered User
 
Join Date: Feb 2006
Location: Tamworth, Staffs, United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP insert into sql date problem

Hi people,

Got a slight problem. Im new to asp and ive been set the task to create a web front end access db back end database.

Im trying to insert values into the database but i have lots of date fields. It only seems to work when i fill in all the date fields. My code is:

sql="INSERT INTO tblProject (managerid,"
sql=sql & "salesmanid,siteid,sectorid,customername,customerl ocation,vehicleproject,typeid,a3due,a0,a1,a2,a3,a4 ,a5,a6,quoted,orderrec,comments,status)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("selmanager") & "',"
sql=sql & "'" & Request.Form("selsalesman") & "',"
sql=sql & "'" & Request.Form("selcostsite") & "',"
sql=sql & "'" & Request.Form("selsector") & "',"
sql=sql & "'" & Request.Form("txtcustomer") & "',"
sql=sql & "'" & Request.Form("txtlocation") & "',"
sql=sql & "'" & Request.Form("txtvehicle") & "',"
sql=sql & "'" & Request.Form("seltype") & "',"
sql=sql & "'" & Request.Form("txttarg") & "',"
sql=sql & "'" & Request.Form("txta0") & "',"
sql=sql & "'" & Request.Form("txta1") & "',"
sql=sql & "'" & Request.Form("txta2") & "',"
sql=sql & "'" & Request.Form("txta3") & "',"
sql=sql & "'" & Request.Form("txta4") & "',"
sql=sql & "'" & Request.Form("txta5") & "',"
sql=sql & "'" & Request.Form("txta6") & "',"
sql=sql & "'" & Request.Form("txtquote") & "',"
sql=sql & "'" & Request.Form("txtrec") & "',"
sql=sql & "'" & Request.Form("txtcomments") & "',"
sql=sql & "'" & Request.Form("selstatus") & "')"

In the database i have the date fields set to short date. I know the problem is Null values but i aint gotta clue how to fix it.

the sql looks like:
INSERT INTO tblProject (managerid,salesmanid,siteid,sectorid,customername ,customerlocation,vehicleproject,typeid,a3due,a0,a 1,a2,a3,a4,a5,a6,quoted,orderrec,comments,status) VALUES ('Fred','Bill','Burton','BS and Ceilings','test','test','test','New Business','','01/01/2005','01/01/2005','01/01/2006','01/01/2006','01/01/2006','01/01/2006','01/01/2006','01/01/2006','01/01/2006','test','Won')

Any help on this would be greatly appreciated.

Thanks

Mark
__________________
M Dayton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old February 18th, 2006, 10:43 AM
Friend of Wrox
Points: 2,450, Level: 20
Points: 2,450, Level: 20 Points: 2,450, Level: 20 Points: 2,450, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.aspfaq.com/show.asp?id=2023
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sql Insert -- date format issue feets Access VBA 2 June 12th, 2007 01:11 PM
INSERT DATE INTO SQL SERVER prasanta2expert ASP.NET 1.0 and 1.1 Basics 1 January 4th, 2007 08:27 AM
How to insert date in Sql Server through aspx page jay4ever_2000 ASP.NET 1.0 and 1.1 Professional 4 February 20th, 2006 08:53 AM
Need help with ASP SQL Date problem bleutiger Classic ASP Professional 6 January 21st, 2005 12:41 AM
ASP SQL Date Problem Please help bleutiger Classic ASP Databases 5 January 20th, 2005 05:15 PM



All times are GMT -4. The time now is 01:49 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc