|
|
 |
| 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.
|
 |

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
|
|
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
|

February 18th, 2006, 10:43 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |