|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Updating a Access 2000 Database with Asp and I'm getting a Syntax error?
<i><b>Originally posted by : Stephen King (slacker@surrealist.com)</b></i><br />Here is my code. it work on other pages but they don't have dates and times in them. any help is appreciated<br /><%<br />dim wsname, wsdate, stime, etime, dept, wstype, id<br />wsname = Request.Form("wsname")<br />wsdate = Request.Form("wsdate")<br />stime = Request.Form("stime")<br />etime = Request.Form("etime")<br />dept = Request.Form("dept")<br />wstype = Request.Form("wstype")<br />id = Request.Form("id")<br /><br /> ConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("capsdatabasecaps.mdb") & ""<br /> set my_conn= Server.CreateObject("ADODB.Connection")<br /> set rs = Server.CreateObject("ADODB.RecordSet")<br /> <br /> strSql = "UPDATE workshops SET "<br /> strSql = strSql & "WorkshopName='" & wsname & "',"<br /> strSql = strSql & " Date='" & wsdate & "',"<br /> strSql = strSql & " StartTime='" & stime & "',"<br /> strSql = strSql & " EndTime='" & etime & "',"<br /> strSql = strSql & " Dept='" & dept & "',"<br /> strSql = strSql & " Type='" & wstype & "' "<br /> strSql = strSql & "WHERE id =" & id <br /> <br /> response.write strsql & "<br>"<br /> <br /> my_conn.open ConnString<br /> Set RS = my_Conn.Execute(strSql)<br /><br />%><br /><br />i get a this error "Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. <br />"<br /><br />thanks for any help<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Troy Guerra (troygtroy@yahoo.com)</b></i><br />Stephen King,<br /><br /> You write good books. Try putting pound signs instead of single quotes around the date. Access does not like quotes around dates, only pound signs.<br /><br />Hope this helps,<br />Troy Guerra<br /><br />------------<br />Stephen King at 10/4/2000 11:36:20 AM<br /><br />Here is my code. it work on other pages but they don't have dates and times in them. any help is appreciated<br /><%<br />dim wsname, wsdate, stime, etime, dept, wstype, id<br />wsname = Request.Form("wsname")<br />wsdate = Request.Form("wsdate")<br />stime = Request.Form("stime")<br />etime = Request.Form("etime")<br />dept = Request.Form("dept")<br />wstype = Request.Form("wstype")<br />id = Request.Form("id")<br /><br /> ConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("capsdatabasecaps.mdb") & ""<br /> set my_conn= Server.CreateObject("ADODB.Connection")<br /> set rs = Server.CreateObject("ADODB.RecordSet")<br /> <br /> strSql = "UPDATE workshops SET "<br /> strSql = strSql & "WorkshopName='" & wsname & "',"<br /> strSql = strSql & " Date='" & wsdate & "',"<br /> strSql = strSql & " StartTime='" & stime & "',"<br /> strSql = strSql & " EndTime='" & etime & "',"<br /> strSql = strSql & " Dept='" & dept & "',"<br /> strSql = strSql & " Type='" & wstype & "' "<br /> strSql = strSql & "WHERE id =" & id <br /> <br /> response.write strsql & "<br>"<br /> <br /> my_conn.open ConnString<br /> Set RS = my_Conn.Execute(strSql)<br /><br />%><br /><br />i get a this error "Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br /><br />[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. <br />"<br /><br />thanks for any help<br />
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Updating a Access 2000 Database with Asp and I'm getting a Syntax error? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|