
November 18th, 2003, 10:05 AM
|
|
Junior Member
|
|
Join Date: Nov 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
importing special characters
I'm using VB6 ADO to read data from a text file, assign it to string variables and import it into an MS SQL database.
One of the fields is the account name. It could have an apostrophe in it (Bob's Store).
I use the INSERT statement to add the record.
"INSERT tablename (name, address, ...) " _
& "VALUES ('" & strName & "', '" & strAddress & "', "' & ...)"
If strName includes an apostrophe, the procedure fails; it's getting mixed up with the other apostrophes / single quotes in the VALUES syntax. How can I treat the apostrophe as a text character and not a special character? I've tried a lot of options, but nothing seems to work.
Thanks for any help you can provide!
Doug
|