|
-
Nov 16th, 2009, 01:49 PM
#1
Thread Starter
Fanatic Member
Single Quote in where clause causing problems.
Hello: i have a simple select statement and i ran accross a situation where it's erroring out because of a single quote that a user assigned to the customer name:
select * from tblCustomer where customername='PLATO'S'
here's my sql:
select * from tblCustomer where customername='" & sCustomerName & '"
I would like to allow the user to insert customer's w/ the single quote.
Is there a way to change my syntex so that I can allow for them?
e.g. i can use instr to determine if the customer name has a single quote and then if it does, I can replace it with the correct syntax needed for the sql?
thanks for your help,
Proctor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|