This is a discussion on SQL Server ODBC error within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hello: I have a VB program that establishes a connection to a SQL server and insert some data. For ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello: I have a VB program that establishes a connection to a SQL server and insert some data. For some reason, I receive the following error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: Incorrect syntax near '17'. Any idea what causes this error? I use the same method to insert data from a VB program before, and it has been working fine. Thanks. Quin |
| |||
| Post some sample code or the line that is generating the error. AB -- You don't pay to get spam, why pay to clean it? Visit http://www.spammarshall.com to create an account for free <http://www.spammarshall.com> Quin wrote: >Hello: > > I have a VB program that establishes a connection to a >SQL server and insert some data. For some reason, I >receive the following error: > > [Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: >Incorrect syntax near '17'. > > Any idea what causes this error? I use the same method >to insert data from a VB program before, and it has been >working fine. > > Thanks. > >Quin > > |
| |||
| AB: The line that generates the error is as follow: DBConnect.Execute strSQL where DBConnect is a connection, which is already open. strSQL is an insert statement like strSQL = _ "insert into tableA(col1) values('valueForCol1');" I put something generic, hopefully it is easier to read. The strange thing is that I used the same code somewhere before, except for another table. And it works well. And when I use the insert statement in SQL Analyzer, it works. Let me know if you need more information. Thanks. Quin >-----Original Message----- >Post some sample code or the line that is generating the error. > >AB > > >-- > >You don't pay to get spam, why pay to clean it? >Visit http://www.spammarshall.com to create an account for free ><http://www.spammarshall.com> > > >Quin wrote: > >>Hello: >> >> I have a VB program that establishes a connection to a >>SQL server and insert some data. For some reason, I >>receive the following error: >> >> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: >>Incorrect syntax near '17'. >> >> Any idea what causes this error? I use the same method >>to insert data from a VB program before, and it has been >>working fine. >> >> Thanks. >> >>Quin >> >> > > |
| ||||
| AB: This matter has been resolved. It is the subsequent SQL statment that raised this error. Thanks. Quin >-----Original Message----- >Post some sample code or the line that is generating the error. > >AB > > >-- > >You don't pay to get spam, why pay to clean it? >Visit http://www.spammarshall.com to create an account for free ><http://www.spammarshall.com> > > >Quin wrote: > >>Hello: >> >> I have a VB program that establishes a connection to a >>SQL server and insert some data. For some reason, I >>receive the following error: >> >> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 2: >>Incorrect syntax near '17'. >> >> Any idea what causes this error? I use the same method >>to insert data from a VB program before, and it has been >>working fine. >> >> Thanks. >> >>Quin >> >> > > |
| Thread Tools | |
| Display Modes | |
|
|