Results 1 to 2 of 2

Thread: SQL Insert Command Problem...

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 1999
    Location
    Malaysia
    Posts
    7

    Post

    my problem is centered on the txtpdetails textbox section. Whenever a value with ' such as "It's a wonderful day" is type in the textbox and error occurs due to the quotation mark.

    Is there anyway around this problem? Other than having to make the user go type "It''s a wonderful day" ?

    s_sql = "Insert into " & s_tblname & (quot_no, prod_no, prod_details, prod_qty, prod_price, prod_amount)
    values ('" & txtrefno & "','" & s_current & "','" & txtpdetails & "'," & txtqty & "," & s_curr & "," & s_curr2 & ")"
    env.cnn.Execute s_sql


  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316

    Post

    What you should do is change the ' to a " in the code then when they type a ' there is no problem. You should also check for a " in the text and replace it with a ' if one is typed.

    Understand???

    [email protected] if not.

    John Murphy
    Co Galway
    Republic of Ireland

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