Click to See Complete Forum and Search --> : Quotes (") in Visual Basic String...


ZF_NeAlvey
12-01-2001, 10:27 PM
Hey guys...This is ridiculous. I'm trying to put quotes in a string. What I have been doing is:

strQuery = "select * from tblCustomers where tblCustomer.Cust_Id = \"" & text1(2) & "\""

Is this correct? I thought you used \". However.... I tried this to find out.

strQuery = "select * from tblCustomers where tblCustomer.Cust_Id = \"" & text1(2)

I hit enter to finish the line and it gave me:

strQuery = "select * from tblCustomers where tblCustomer.Cust_Id = \"" & text1(2)"

The strQuery is defined and all of that. I've tried hardcoding the above query (with the " " around the correct value) into the control and it works fine. Thanks a lot!!

-=-Neal Alvey



------------------
...NeAlvey, the world's best Sim Farm player EVER...and you should know that!

cyrustch
12-02-2001, 11:26 AM
try this

strQuery = "SELECT * FROM tblCustomers WHERE tblCustomer.Cust_Id = '" & text1(2) & "'"

[This message has been edited by cyrustch (edited December 02, 2001).]

ZF_NeAlvey
12-02-2001, 12:05 PM
Yeah, I tried that as well but had no luck. However, I did use chr$(34) command to convert the ascii value to a character and it works like a dream. Thanks for the reply!

-=-Neal

------------------
...NeAlvey, the world's best Sim Farm player EVER...and you should know that!