Results 1 to 3 of 3

Thread: Database

  1. #1
    Join Date
    Dec 1969

    Default Database

    i realise that if i enter ' in a text field or textarea, i will get an do i correct this error?

  2. #2
    Join Date
    Dec 1969

    Default Read the FAQ

    This is a very commonly asked question.<BR><BR>You have to enclode your variables with double-double quotations.<BR><BR>Example:<BR><BR>strLastName = "O&#039;Reilly"<BR><BR>SQL = "UPDATE Table SET LName = "" & strLastName & "" WHERE ID = &#039;" & ID & "&#039;"<BR><BR>For more info check the FAQs

  3. #3
    Join Date
    Dec 1969

    Default CheezWhiz should read FAQ!!

    He&#039;s right, that the answer is in the ASPFAQs (link at top right of this page), but he completely missed the fact that, in a SQL statement, if you want to have a &#039; inside a string you must replace the single &#039; with a pair of &#039; marks!<BR><BR>Using a pair of " marks inside a VBS string means that you will get one " mark *IN THE VBS STRING*. So is you really did this:<BR><BR>SQL = "UPDATE Table SET LName = "" & strLastName & "" WHERE ID = &#039;" & ID & "&#039;"<BR><BR>And then did Response.Write SQL, you would see:<BR><BR>&nbsp; &nbsp; UPDATE Table SET LName = " & strLastName & " WHERE ID = &#039;7812&#039;<BR><BR>Yes, really. And I do not think that your database contains any last name for somebody named<BR><BR>&nbsp; &nbsp; &nbsp; &nbsp; [space]&[space]strLastName[space]&[space]<BR><BR>So go here:<BR><BR>Hokay?<BR><BR>[Sorry Cheez, but you blew this one to smithereens. First time I&#039;ve seen you do that! Tired tonight?]<BR><BR><BR>

Posting Permissions

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