Hey,

In standard ANSI SQL, you escape the quote by ... the quote symbol.
Your select statement should therefore say :

SELECT * FROM Players WHERE LName LIKE '%D''Silva%'

Cheers,
Henri





[EMAIL PROTECTED] on 09/19/2002 10:38:09 AM

To:    [EMAIL PROTECTED], [EMAIL PROTECTED]
cc:

Subject:    RE: How to query for an apostrophe




Hi,

The following will probably work for you:

  SELECT * FROM Players WHERE LName LIKE '%D\'Silva%' ESCAPE '\'

I haven't tested this with Access, but I do a similar thing with MS SQL
Server which works OK.

Regards,

Rob

 -----Original Message-----
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 4:56 AM
To: [EMAIL PROTECTED]
Subject: How to query for an apostrophe
Hiya. How can I search for the following?:

D'Silva

If I try to search for it, with the following query string:

SELECT * FROM Players WHERE LName LIKE `%D'Silva%`

I get the following error:

Died while executing:[Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 1. (SQL-07001)(DBD: st_execute/SQLExecute err=-1) at
c:\inetpub\wwwroot\EBA\cgi-bin\player_search.pl line 709.

Is there a way to escape the apostrophe?

Thanks for your help!
 Nick Hoffman
 [EMAIL PROTECTED]



This message is intended only for the use of the person(s) ("The intended
Recipient(s)") to whom it is addressed.  It may contain information which
is privileged and confidential within the meaning of applicable law.  If
you are not the intended recipient, please contact the sender as soon as
possible.  The views expressed in this communication are not necessarily
those held by LYNX Express Limited.




Reply via email to