[AccessD] Function for "scrubbing" strings before inserting them into SQL statements?

Michael Tucker mtucker at myrealbox.com
Fri May 2 14:10:21 CDT 2003


Thanks for the response.  My brain is a little fuzzy on this, all these
quotation marks are turning my eyes to mush...

Replace (mystring, """", """""")

Is this what I'm looking for or is there a better way using chr codes and
what not?


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Friday, May 02, 2003 12:08 PM
To: 'accessd at databaseadvisors.com'

Use the replace function, to replace all double quotes, with two double
quotes.

Drew

-----Original Message-----
From: Michael Tucker [mailto:mtucker at myrealbox.com]
Sent: Friday, May 02, 2003 10:47 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Function for "scrubbing" strings before inserting them
into SQL statements?


Hi everyone,

I'm sure everybody has faced this situation, but I can't seem to figure out
an elegant solution.  I have a webpage interface to an Access database where
users can enter notes on various things.  Of course the user may enter
apostrophes or quotation marks in these notes, but of course that sends my
SQL statement into a tizzy.  A sample of my SQL statement...

strSQL = "INSERT INTO tblEmployeeMonthlyTask ([TaskDescription]) VALUES "
strSQL = strSQL & "('" & Request.Form("txtTaskDescription") & "')"

Is there a function that will convert my string so that it usable inside of
this SQL statement even if it contains apostrophes and quotes?

Thank you.

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list