Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: VBS function to strip out invalid query characters


Message #1 by "Meredith Shaebanyan" <merediths@p...> on Mon, 2 Apr 2001 13:03:40 -0700

	Disclaimer: I am not an access programmer of a vbs programmer; I'm sure

this question will sound dumb to some of the experienced access vetrans on

this list.

	Question: Is there a function to strip out invalid characters such as "'"

from queries:

	Background: It's for a web-based forum system. The user fills out a text

box with his text, and it appears on the page ( simialer to weblogs such as

slashdot ). Unfortunately, single quotes in queries cause an ODBC error.

	Thanks in advance!



Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Mon, 02 Apr 2001 13:40:55 -0700
Look at the Replace() function--you can use that to double up a single

quote, which should render it acceptable.  So for instance:



From my debug window:



?replace("roy's", "'", "''")

roy''s



HTH,



-Roy



-----Original Message-----

From: Meredith Shaebanyan [mailto:merediths@p...]

Sent: Monday, April 02, 2001 1:04 PM

To: Access

Subject: [access] VBS function to strip out invalid query characters







	Disclaimer: I am not an access programmer of a vbs programmer; I'm

sure

this question will sound dumb to some of the experienced access vetrans on

this list.

	Question: Is there a function to strip out invalid characters such

as "'"

from queries:

	Background: It's for a web-based forum system. The user fills out a

text

box with his text, and it appears on the page ( simialer to weblogs such as

slashdot ). Unfortunately, single quotes in queries cause an ODBC error.

	Thanks in advance!




  Return to Index