|
-
Jul 18th, 1999, 10:00 PM
#1
I have a sql statement where i pass a variable instead of passing the value directly. for ex:
strQuery = ("Select * from tablename" _
& " where [Company Name]= " & "'" + Trim(variablename) + "'")
when I pass ABC as variable value its working fine. But when I pass ABC's as the value it is giving me a error.
any help might help.
thankyou.
-
Jul 19th, 1999, 11:53 AM
#2
Lively Member
Hi,
Try replacing the single quote with two single quotes side by side:
Abc's --> Abc''s
HTH,
Preeti
-
Jul 19th, 1999, 05:39 PM
#3
I tryed doing that it doesnt do any good.
-
Jul 19th, 1999, 06:24 PM
#4
Lively Member
Hi,
Okay, this might get confusing:
You have to surround the whole string in double quotes and then place physically place a single quote. And the quotes need to be treated as strings and not string delimiters:
"VALUES(""ABC" & "'" & "S"")"
The first two double quotes places one double quote before the ABS as a string, then the & "'" & adds the single quote as a string, then the "S"", places a double quote after the S still as part of the string.
HTH,
Preeti
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
|