SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 4th, 2000, 02:36 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
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 />

Reply With Quote
  #2  
Old October 5th, 2000, 07:42 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<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 />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Updating a Access 2000 Database with Asp and I'm getting a Syntax error?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT