Having trouble with using quotes in records

Results 1 to 4 of 4

Thread: Having trouble with using quotes in records

  1. #1
    Sam Pfanstiel Guest

    Default Having trouble with using quotes in records

    In trying to make an only data entry form, I have found that I cannot allow either quotes (") or apostrophes (&#039), depending on which one I decide to pass the string to my ADO connection. Does someone have a low memory consumption parsing string that I can use to replace single quotes with double quotes, or get around this difficulty?<BR><BR>I wrote a parsing routine (below) but this takes up too much memory and time on larger submissions. Any suggestions?<BR><BR>&#060;code><BR>Dim locBad<BR>Dim lookBad<BR>For each strKey in dicSubmit<BR> For lookBad = 1 to len(dicSubmit(strKey))<BR> If mid(dicSubmit(strKey), lookBad, 1) = "&#039" then<BR> dicSubmit(strKey) = left(dicSubmit(strKey), lookBad) & "&#039" & right(dicSubmit(strKey), len(dicSubmit(strKey)) - lookBad)<BR> lookBad = lookBad + 1<BR> End if<BR> Next<BR>next<BR><BR>&#060;/code><BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    168

    Default RE: Having trouble with using quotes in records

    &nbsp;<BR>var=replace(String_with_apostrophes,"&#0 39","&#039&#039")<BR><BR>The same will work with "&#039s, SQL allows double apostrophes and double quotes.<BR><BR>Hope this helps... Cheers!

  3. #3
    Sam Pfanstiel Guest

    Default RE: Having trouble with using quotes in records

    Thanks so much. This works like a charm!<BR><BR>I knew there had to be a command for this, but I had never come across it until today. Thanks for helping out a desparate amateur!<BR><BR>Sam<BR><BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Having trouble with using quotes in records

    You can also read this article, which gives a more thorough explanation explaining why the appostrophe doesn&#039t work, and why you need to use the Replace function:<BR><BR>http://www.4guysfromrolla.com/webtech/051899-1.shtml<BR><BR>Have a great weekend, and happy programming!


Posting Permissions

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