Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 14th, 2007, 02:29 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft OLE DB Provider for ODBC Drivers

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,'','','','')' at line 1
/save_inc.asp, line 47

When i use response.write(sql) instead of db_conn.execute ,then it works fine ...but with db_conn.execute(sql) it gives me this error .

for i=0 to (tSim_num)
Line 47:
sql = "insert into ts values (null,"&projID&",'"&t_car(i)&"','"&t_cartype(i)&"' ,'"&t_host(i)&"','"&t_dir(i)&"','"&_pin(i)&"','"&t _ip(i)&"',"&t_num(i)&","&t_npc(i)&","&t_UID1(i)&", "&t_UID2(i)&",'"&tSim_by(i)&"','"&t_par(i)&"','"&t _s(i)&"','"&t_auto(i)&"')"
        db_conn.execute(sql)
    next
Plz help !

  #2 (permalink)  
Old March 14th, 2007, 02:40 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Do a response.write(sql) again and examine your INSERT statement very closely. You have a syntax error somewhere and, judging from the error, it has to do with a misplaced '

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
  #3 (permalink)  
Old March 14th, 2007, 02:54 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

did that again with response.write , but i don't see any misplaced ' or something there

  #4 (permalink)  
Old March 14th, 2007, 02:58 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Nevertheless, you have a syntax error somewhere. Paste your string into Query Browser, it should give you a better idea of what is out of place.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
  #5 (permalink)  
Old March 14th, 2007, 05:07 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by phantom3008
 Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,'','','','')' at line 1
/save_inc.asp, line 47

When i use response.write(sql) instead of db_conn.execute ,then it works fine ...but with db_conn.execute(sql) it gives me this error .

for i=0 to (tSim_num)
Line 47:
sql = "insert into ts values (null,"&projID&",'"&t_car(i)&"','"&t_cartype(i)&"' ,'"&t_host(i)&"','"&t_dir(i)&"','"&_pin(i)&"','"&t _ip(i)&"',"&t_num(i)&","&t_npc(i)&","&t_UID1(i)&", "&t_UID2(i)&",'"&tSim_by(i)&"','"&t_par(i)&"','"&t _s(i)&"','"&t_auto(i)&"')"
        db_conn.execute(sql)
    next
Plz help !
I would be surprised if the sql string builds correctly for display in your response.write test, since you have a variable named with a leading underscore:
_pin

This will be rejected as a compilation error before the code will even run. I am suspecting that this is not the actual code you are working with.

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems
  #6 (permalink)  
Old March 15th, 2007, 09:01 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

its t_pin, i missed that when copied here...anyways thanks to u and dparsons , prob is solved ...the loop was adding an extra insert...

  #7 (permalink)  
Old March 15th, 2007, 09:39 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you are asking for help on a forum you will find the contributors much more helpful if you actually paste your real code and include all relevant parts of it. There was no way we could have been of any use based on your original post.

It appears now that what was happening is that you were attempting to process an insert that contained no data, and this of course will blow up because the sql statement would have a bunch of commas and single quotes without and data. However - using a Response.Write would have revealed this, and would not have "worked" - that is, the last response.write in your loop would have been a malformed sql statement.

In other words, the relevant part of this code is not even shown - it is that you had an off by one error (obo).

Woody Z
http://www.learntoprogramnow.com
How to use a forum to help solve problems


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft OLE DB Provider for ODBC Drivers (0x8004 phantom3008 ASP.NET 1.0 and 1.1 Basics 6 April 25th, 2007 10:30 AM
Microsoft OLE DB Provider for ODBC Drivers error ' rajiv_software Classic ASP Basics 6 April 28th, 2005 12:52 AM
Microsoft OLE DB Provider for ODBC Drivers surendran Classic ASP Databases 4 October 27th, 2003 10:23 AM
OLE DB Provider for ODBC Drivers error '80004005' Routhg Access ASP 2 June 11th, 2003 07:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.