Yes I see your point, Paul.  If the bug is in fact in ado or in the oledb
driver for mysql, then I think the solution I outlined below using the
CONCAT and CHAR functions may still apply if only as a workaround to the
presumed ado/oledb bug.

On a related note:
Jay Fesco wrote:
> Paul et al - I think his problem is with quotes, not semicolons.  The line
> "Update tblCompany SET CoName='&quot\;tester&quot\;' WHERE
> CoID=109" is what
> leads me to believe this.

I don't believe that the quotes are a problem at all.  I have used VB/ADO a
lot and I routinely do this (albeit not with the mysql oledb driver).  If
you mean the double-quotes surronding the statement - I believe that this
has been cut and pasted from his vb source, the complete line looking
something like this:
dim szSQL as String
szSQL = "UPDATE tblCompany SET CoName='&quot\;tester&quot\;' WHERE CoID=109"

If I am correct in this assumption then obviously only what is between the
double quotes would reach the query string buffer.  The single quotes need
not be escaped for VB's sake as single-quotes are not significant in VB.
Therefore if he escaped the single quotes, mysql would certainly get
confused because it would not be expecting escape sequences outside of a
quoted literal... right?

I think Paul is probably on the right track in suspecting an ado related
bug - one that probably scans the query string for a semicolon and does not
properly account for its being embeded in a literal string.


> -----Original Message-----
> From: Paul DuBois [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 20, 2001 2: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
>
>


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