Query Syntax Problem...

Eleventeen

Active member
Joined
Jan 3, 2003
Messages
39
Location
Canada
I am using an UPDATE Query in VB something like this:

strSQL = "UPDATE tblCustomer SET CustomerName VALUES " & text1.text & ";"

Now the problem is that if a user puts in a special character like and apostrophe in the text, the query assumes its a quotation mark.

Does anyone know how to get around this?

Thanks in advance
 
With apostrophe s you need to double quote them before inserting into the database.

e.g.

Code:
strSQL = "UPDATE tblCustomer SET (CustomerName) VALUES (" & Replace(text1.text, "", "") & ");"
 
Back
Top