Unix Technical Forum

SQL Server ODBC error

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


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:35 PM
Quin
 
Posts: n/a
Default SQL Server ODBC error

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:35 PM
Ali Baba
 
Posts: n/a
Default Re: SQL Server ODBC error

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



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 07:35 PM
 
Posts: n/a
Default Re: SQL Server ODBC error

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

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 07:35 PM
Quin
 
Posts: n/a
Default Re: SQL Server ODBC error

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

>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:19 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com