Alter a string in an .ASP Page for use in an SQL statement.
Category:
ASP, HTML and XMLType:
SnippetsDifficulty:
BeginningAuthor:
Intelligent Solutions Inc.Version Compatibility: ASP
More information:
When using strings as values in SQL Statements, you must precede and end the value with single quotes, and replace any single quotes (apostrophe) within the string with an additional quote (e.g., ' must become ''). This function handles all this .
The code for the this task is slightly different for VB6 and .ASP, so see the Database section of this site if you want to do the same thing in VB6.
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations: