|
-
January 16th, 2003, 02:13 AM
#1
String Question
Hi
I have a basic question
I am using SQL command/query like
"INSERT INTO table1 (FName) VALUES (' " & sStr & " ' )"
If sStr (the string) contain the char " ' " then I get an error
I understand why it happened but I need a way around it
Thanks
Limor
-
January 16th, 2003, 05:27 AM
#2
If a string that has to be insert or update into a database countains any single '
you have to double them to 2 single ' , so the database knows it is a character of the string and not of the whole sql-statement.
Add the following line just before you put the whole sql-statement together.
sStr = sStr.Replace("'", "''")
-
January 16th, 2003, 02:51 PM
#3
Yes the old DoubleQuote Problem
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
|