Hello folks

Thanks first of all for all your replies, this is helping to isolate the
problem, which I now have found is not an ADO problem but a DBTools 1.0.9
problem in it's parser.

Here is a way to create the problem:

CREATE TABLE tblCompany_test (CoName VARCHAR(50));

INSERT INTO tblCompany_Test values('Test')

run this query using dbtools:

UPDATE tblCompany_Test set coname = 'Test1;'

Note, this update statement with 1 semi colon works fine, whereas this

#run this query using dbtools:
UPDATE tblCompany_Test set coname = ';Test1;'

Produces the following error:

"You have an error in your syntax SQL near "'" at line 1

I was doing something pretty stupid in the VB code which was causing a
different problem and then using DBTools to try to debug the SQL and then
got the error I mentioned, so assumed I was getting the same error in VB,
but wasn't in fact.

So I think it all comes down to a DBTools problem, but I could be wrong ( I
often am!)

Thanks again for people's advice.

John.


-----Original Message-----
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 20, 2001 7:15 PM
To: [EMAIL PROTECTED]; johnlucas-Arluna; [EMAIL PROTECTED]
Subject: RE: Semi colons in text fields in update statement


At 2:00 PM -0400 9/20/01, Will French wrote:
>There probably is a better way but the following should work:
>
>"UPDATE tblCompany SET CoName=CONCAT('&quot', CHAR(59), 'tester', CHAR(59),
>'&quot', CHAR(59)) WHERE CoID=109"
>
>Like you, I believe there probably is an escape sequence for the semi-colon
>but I'll be damned if I can find it documented.  Until someone else
>enlightens us both, hopefully the above solution will see you through.

There is no need for such an escape sequence because semicolons
in strings are not special.  Maybe it's an ADO bug.

>
>>  -----Original Message-----
>>  From: johnlucas-Arluna [mailto:[EMAIL PROTECTED]]
>>  Sent: Thursday, September 20, 2001 1:45 PM
>>  To: [EMAIL PROTECTED]
>>  Subject: Semi colons in text fields in update statement
>>
>>
>>  Hello
>>
>>  I'm trying to do the following:
>>
>>  "Update tblCompany SET CoName='"tester"' WHERE CoID=109"
>>
>>  But getting an error message
>>
>>  I tried the escape character "\" like
>>
>>  "Update tblCompany SET CoName='&quot\;tester&quot\;' WHERE CoID=109"
>>
>>  but get the same error
>>
>>  This happens whether I use ADODB in VB or if I try executing the query
>>  through DBTools 1.0.9
>>
>>  Can anybody tell me how I can escape the semi-colon please?
>>
>>  Many thanks for any help
>>
>  > John
>  >


--
Paul DuBois, [EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to