Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT * FROM and the apostrophe
Message
From
15/10/1999 09:10:50
 
General information
Forum:
Visual Basic
Category:
VBScript
Miscellaneous
Thread ID:
00276634
Message ID:
00276776
Views:
26
Thanks Eric,
I tried and work but not found the record, remember that the record has the apostrophe saved
I am using ASP with VbScript.

Thanks,

Gerardo


>>Hello!
>>I got a problem using apostrophe in the fields, upon I need to search a data I got error because the data has apostrophe, here is a example:
>>cVar="Bob's Sample"
>>cSearch="SELECT * FROM CUSTOMER WHERE BusinessName= '"&cVar&"'"
>>MyData.Open cSearch, objCmd, adOpenKeyset, adLockOptimistic, adCmdText
>>
>>At this time I got error because the apostrophe, and if I try to not use apostrophe after BusinessName I got other error because it is a character and need the apostrophe.
>
>If using VB6, double the single quotes using this:
>cSearch="SELECT * FROM CUSTOMER WHERE BusinessName= '" & replace(cVar, "'", "''") & "'"
>
>If not using VB6, then come back here!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform