Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 unclosed quotation mark

Author  Topic 

jasonphd
Starting Member

3 Posts

Posted - 2004-08-18 : 09:41:23
I get this following error message when I try to execute a SQL INSERT statement:

unclosed quotation mark before the character string '0.4'.

None of my variables have double or single quotes or any special characters at all. The data I'm putting into the database looks like this:

Freezer|16.0|Cooler|41.9|IceCream1|-6.5|IceCream2|0.4

I run 4 insert statements and the first 3 work correctly, only the fourth gives the error. The first insert statment puts freezer and 16.0 into the db. Then the second puts cooler and 41.9 into the db ..etc...etc... But my program gives that error message when putting icecream2 and 0.4 into the db. There are no special characters and there are no leading or trailing spaces in the data. And the syntax I used for the fourth insert statement is exactly like that I used for the first 3.

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-08-18 : 09:49:51
quote:
None of my variables have double or single quotes or any special characters at all. The data I'm putting into the database looks like this:...
There are no special characters and there are no leading or trailing spaces in the data. And the syntax I used for the fourth insert statement is exactly like that I used for the first 3
SQL Server must be broken then :)

What tool are you using to perform the inserts?
Can you write out the insert statement to examine it before making the db call?
SOund like extraneous data is being passed somehow..
Go to Top of Page

jasonphd
Starting Member

3 Posts

Posted - 2004-08-18 : 16:49:33
well...
when i pull the data from the asdf|87|asdf2|65.4|bda|78|eower|85 string something goes wrong witht the 4th set... If i pull the data from the string and display it in a message box it looks fine... however when it try a command like this:

msgbox("***" & y(7) & "***")

I get a message box like like this: "***85"
with no *** after it...

So I guess my INSERT syntax is correct but my string isn't getting handled correctly. I use the following command to split up my string into an array:

y = Split(x, "|", , CompareMethod.Text)

so the problem is with y(7) I guess

i'm using visual basic .net 2003 and msde 2000 on xp pro
Go to Top of Page

jasonphd
Starting Member

3 Posts

Posted - 2004-08-19 : 09:01:52
i figured out a work around...
if i send the text string to a textbox before i split it up, it works fine.. i.e:
textbox2.text = textstring

then if i perform the split function on textbox2.text it works fine....does anyone know what would cause this?
Go to Top of Page
   

- Advertisement -