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 May 10th, 2000, 04:52 AM
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
Syntax error... but why? Need an extra pair of eyes.

<i><b>Originally posted by : Stefan (rpantern@hotmail.com)</b></i><br />I have made a little application, and it works fine with IIS3/Access95 database. When converting this to IIS4/SQL-srv7 I get a problem with syntax error, and I cannot understand why. I can't see why. It appears only when using UPDATE in combination with WHERE. SELECT/WHERE works fine with then same syntax for "where". Would greatly appreciate a solution to this.<br /><br />strconn = "Driver={SQL Server} ; Description=uppdrag ; SERVER=EXC ; UID=sa ; PWD=pwd ; DATABASE=support"<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br /><br />Conn.Open strconn<br /><br />Conn.Execute ("UPDATE dsuppdrag SET kommentar = '" & request.form("kommentar") & "' WHERE counter = " & request.querystring("hid") & ";")<br /><br />Conn.Close<br /><br /><br />The error message says:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br />[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ';'. <br /><br />

Reply With Quote
  #2  
Old May 10th, 2000, 12:32 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 : Bob</b></i><br />Get rid of the trailing ;<br /><br /><br />------------<br />Stefan at 5/10/2000 1:52:55 AM<br /><br />I have made a little application, and it works fine with IIS3/Access95 database. When converting this to IIS4/SQL-srv7 I get a problem with syntax error, and I cannot understand why. I can't see why. It appears only when using UPDATE in combination with WHERE. SELECT/WHERE works fine with then same syntax for "where". Would greatly appreciate a solution to this.<br /><br />strconn = "Driver={SQL Server} ; Description=uppdrag ; SERVER=EXC ; UID=sa ; PWD=pwd ; DATABASE=support"<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br /><br />Conn.Open strconn<br /><br />Conn.Execute ("UPDATE dsuppdrag SET kommentar = '" & request.form("kommentar") & "' WHERE counter = " & request.querystring("hid") & ";")<br /><br />Conn.Close<br /><br /><br />The error message says:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br />[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ';'. <br /><br />

Reply With Quote
  #3  
Old May 10th, 2000, 04:28 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 : </b></i><br />Already tried that, it results in another syntax error near "=" instead. *sigh*<br /><br /><br />------------<br />Bob at 5/10/2000 9:32:17 AM<br /><br />Get rid of the trailing ;<br /><br /><br />------------<br />Stefan at 5/10/2000 1:52:55 AM<br /><br />I have made a little application, and it works fine with IIS3/Access95 database. When converting this to IIS4/SQL-srv7 I get a problem with syntax error, and I cannot understand why. I can't see why. It appears only when using UPDATE in combination with WHERE. SELECT/WHERE works fine with then same syntax for "where". Would greatly appreciate a solution to this.<br /><br />strconn = "Driver={SQL Server} ; Description=uppdrag ; SERVER=EXC ; UID=sa ; PWD=pwd ; DATABASE=support"<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br /><br />Conn.Open strconn<br /><br />Conn.Execute ("UPDATE dsuppdrag SET kommentar = '" & request.form("kommentar") & "' WHERE counter = " & request.querystring("hid") & ";")<br /><br />Conn.Close<br /><br /><br />The error message says:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br />[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ';'. <br /><br />

Reply With Quote
  #4  
Old May 11th, 2000, 01:07 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 : </b></i><br />Response.Write your query string to make sure you've got what you think you've got. Then take the output of the query and paste it in the SQL Query tool. That's a good place to debug the query.<br /><br /><br />------------<br /> at 5/10/2000 1:28:35 PM<br /><br />Already tried that, it results in another syntax error near "=" instead. *sigh*<br /><br /><br />------------<br />Bob at 5/10/2000 9:32:17 AM<br /><br />Get rid of the trailing ;<br /><br /><br />------------<br />Stefan at 5/10/2000 1:52:55 AM<br /><br />I have made a little application, and it works fine with IIS3/Access95 database. When converting this to IIS4/SQL-srv7 I get a problem with syntax error, and I cannot understand why. I can't see why. It appears only when using UPDATE in combination with WHERE. SELECT/WHERE works fine with then same syntax for "where". Would greatly appreciate a solution to this.<br /><br />strconn = "Driver={SQL Server} ; Description=uppdrag ; SERVER=EXC ; UID=sa ; PWD=pwd ; DATABASE=support"<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br /><br />Conn.Open strconn<br /><br />Conn.Execute ("UPDATE dsuppdrag SET kommentar = '" & request.form("kommentar") & "' WHERE counter = " & request.querystring("hid") & ";")<br /><br />Conn.Close<br /><br /><br />The error message says:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br />[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ';'. <br /><br />

Reply With Quote
  #5  
Old June 9th, 2000, 04:46 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 : anon</b></i><br />assuming from the lack of an apostrophe near the "request.querystring("hid")" poriton of your sql code...you are trying to insert a numeric value. Try converting the querystring variable to a number (pref. integer) and sql shouldn't bounce it then. (also leave the trailing ";"'s for access only...sql doesn't need them.<br /><br /><br />------------<br /> at 5/11/2000 10:07:17 AM<br /><br />Response.Write your query string to make sure you've got what you think you've got. Then take the output of the query and paste it in the SQL Query tool. That's a good place to debug the query.<br /><br /><br />------------<br /> at 5/10/2000 1:28:35 PM<br /><br />Already tried that, it results in another syntax error near "=" instead. *sigh*<br /><br /><br />------------<br />Bob at 5/10/2000 9:32:17 AM<br /><br />Get rid of the trailing ;<br /><br /><br />------------<br />Stefan at 5/10/2000 1:52:55 AM<br /><br />I have made a little application, and it works fine with IIS3/Access95 database. When converting this to IIS4/SQL-srv7 I get a problem with syntax error, and I cannot understand why. I can't see why. It appears only when using UPDATE in combination with WHERE. SELECT/WHERE works fine with then same syntax for "where". Would greatly appreciate a solution to this.<br /><br />strconn = "Driver={SQL Server} ; Description=uppdrag ; SERVER=EXC ; UID=sa ; PWD=pwd ; DATABASE=support"<br /><br />Set Conn = Server.CreateObject("ADODB.Connection")<br /><br />Conn.Open strconn<br /><br />Conn.Execute ("UPDATE dsuppdrag SET kommentar = '" & request.form("kommentar") & "' WHERE counter = " & request.querystring("hid") & ";")<br /><br />Conn.Close<br /><br /><br />The error message says:<br /><br />Microsoft OLE DB Provider for ODBC Drivers error '80040e14' <br />[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ';'. <br /><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Syntax error... but why? Need an extra pair of eyes.


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





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek