Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Harold H. Dessart
Starting Member
1 Post |
Posted - 2006-09-07 : 11:04:23
|
| I'm trying to Update a Date in my database, but keep getting a Syntax error, and I can't find the problem. Here's the code;<%sStatus = Replace(Request.Form("sStatus"),"'","''")dChangeDate = Replace(Request.Form("dChangeDate"),"'","''")nID = Replace(Request.Form("nID"),"'","''")set oConn = Server.CreateObject("ADODB.Connection")oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & server.mappath("../database/COAKLEY_ACCESS97.mdb")sSQL = "Update tblCoakleyNew Set sStatus = '" & sStatus & "', dChangeDate = #" & dChangeDate & "# " & "Where nID = " & nID & " " oConn.OpenoConn.Execute(sSQL)oConn.CloseSet oConn=Nothing%>Harold |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-07 : 11:19:26
|
| Try printing the content of sSQL! BTW, why are you replacing single quote in dChangeDate with double quotes when the quotes are not valid in dates?Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-09-07 : 11:22:22
|
| That worked fine when I tried it.Note that this is a SQL Server forum - you should try posting this at an ASP.NET and/or Access forum. |
 |
|
|
|
|
|