Subject: ADO
Posted By: setyna Post Date: 11/11/2004 1:01:11 PM
I have a form in access where users submit there entries. There is one text(memo)field on the form. Whenever users use any types of apostrophes they receive an error. Is there a work around for this? see example below.

dim strtxtComments as string
dim db as databse
set db=currentdb

strtxtComments ="This is a test's"

strsql1 = "INSERT INTO tbl_Main_Quality (Comments)" & _
           "select" & "'" & strtxtComments & "'"
db.Execute (strsql1)

Reply By: happygv Reply Date: 11/15/2004 12:58:26 AM
Use Replace() vbscript function to replace all single quotes with double SINGLE QUOTES there.

That should solve this.
Cheers!

_________________________
- Vijay G
Strive for Perfection

Go to topic 22008

Return to index page 716
Return to index page 715
Return to index page 714
Return to index page 713
Return to index page 712
Return to index page 711
Return to index page 710
Return to index page 709
Return to index page 708
Return to index page 707