Results 1 to 3 of 3

Thread: help with sql statement

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    hello,.. I have a problem with an sql statement and the insert into command.

    say the string I want to insert is THAI'S POST

    well since it has a ', how do you make it work with sql without making the string a variable? any suggestions?

    thanks,
    Thai

  2. #2
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    Use chr(34) instead of '

    sStr = "THAI" & chr(34) & "S POST"

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    When dealing with SQL in the SQL server Enterprise manager you double up the single quote. For example:

    select * from table where text like '%''%'

    will get you any instance of a single quote in the field.

Posting Permissions

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



Click Here to Expand Forum to Full Width