SQL Search problem

Everytime when the search word contain a ' (ex. Child's)
my search page cause a problem like:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '%'.
search.asp line 103


the following is my code:

SearchFor = TRIM ( Request("searchFor") )
.
.
.
open_statement = "SELECT * from User where Name like '%" & searchFor & "%' "



How can I fix the problem? Thanks so much for your help.

所有跟帖: 

i just figure it out -iamdumb- 給 iamdumb 發送悄悄話 (115 bytes) () 06/23/2004 postreply 12:00:51

Suggest use search procedure -DBDB- 給 DBDB 發送悄悄話 (885 bytes) () 06/23/2004 postreply 13:32:52

請您先登陸,再發跟帖!