PDA

View Full Version : including string in string



jeff06
07-25-2007, 12:57 PM
sql:
contract="new"

i want to use it in sql string
vba:

sqlstring = ""
sqlstring =sqlstring&"contact="new""

This does not not work
how can I include string in string?
Thanks.

malik641
07-25-2007, 01:18 PM
Hey jeff,

When you use quotes inside string values, you have to place two quotation marks "" to signify a single quotation (") inside the string.

And shouldn't you use apostrophes ' for SQL strings?

sqlString = "" ' No text at all
sqlString = sqlString & "contract = ""new""" ' No text plus 'contract = "new"'

jeff06
07-25-2007, 01:21 PM
Thanks