Quotes (") in Visual Basic String...

Sharky Forums


Results 1 to 3 of 3

Thread: Quotes (") in Visual Basic String...

  1. #1
    Reef Shark
    Join Date
    Aug 2001
    Location
    Northern Kentucky
    Posts
    337

    Post Quotes (") in Visual Basic String...

    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!

  2. #2
    Sushi
    Join Date
    Dec 2001
    Posts
    1

    Post

    try this

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

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

  3. #3
    Reef Shark
    Join Date
    Aug 2001
    Location
    Northern Kentucky
    Posts
    337

    Post

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •