 |
| 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
|
|
|
|

March 14th, 2007, 02:29 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 !
|
|

March 14th, 2007, 02:40 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
================================================== =========
|
|

March 14th, 2007, 02:54 PM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
did that again with response.write , but i don't see any misplaced ' or something there
|
|

March 14th, 2007, 02:58 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
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
================================================== =========
|
|

March 14th, 2007, 05:07 PM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 15th, 2007, 09:01 AM
|
|
Authorized User
|
|
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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...
|
|

March 15th, 2007, 09:39 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |