Guest JDT_71 Posted January 31, 2006 Share Posted January 31, 2006 Does anyone here know how to solve the following problem in the context of a VB6 program using an ADO Recordset?Dim sSQL As StringDim Var As StringsSQL = "INSERT INTO table VALUES ('" & Var & "')" The problem arises if the value of Var contains a single quote character. For example: Jim's car. sSQL is set to : INSERT INTO table VALUES('Jim's car'). Thanks in advance for any responses. Link to comment Share on other sites More sharing options...
aspnetguy Posted January 31, 2006 Share Posted January 31, 2006 use the VB6 Replace function and make (') into (''). SQL uses (') as part of statements but when it sees 2 in a row treats like an apostrophe. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now