Bobby Heid
bheid at appdevgrp.com
Fri May 2 11:52:37 CDT 2003
The code snippet I just sent works in ACC 97 which does not have Replace. But I agree, Replace is the way to go. Bobby -----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' Subject: RE: [AccessD] Function for "scrubbing" strings before inserting them into SQL statements? 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