I am desinging the small program to insert the text from user side. When the user type the data like word don't which it contains apostrophes, its throwing some error in sql 2003. As a front-hand m using vb 6 and back-hand sql2003. I made datatype as varchar. Please help me
You need to escape (eg. don\'t) all apostrophes to prevent this error. In PHP, there's a function that does this already, I'm not sure with vb. In addition, you should filter all the user input because a user can run an unwanted query - such as deleting everything in your database.
I think you may use double apostrophes '' instead of single apostrophes ' Like: INSERT INTO TableName VALUES ('don''t') In vb6, you could use function Replace(txt,"'","''")