README.md

December 4, 2022 ยท View on GitHub

Deal With Apostrophes in SQL Statement

Description

This code allows you to input strings with apostrophes into a database.

More Info

Submitted On
ByWebFFiliates
LevelBeginner
User Rating5.0 (15 globes from 3 users)
CompatibilityASP (Active Server Pages)
CategoryDatabases
WorldASP / VbScript
Archive File

Source Code

<%
'Get the data from the form
Dim strName
'Let's take the string and replace all single apostrophes with double apostrophes
strCompanyName = Replace(Request.form("NAME"), "'", "''")
 'Connect to the Database
Dim strSQL
strSQL = "INSERT YourTable (Name) VALUES ('" &_ strName & "')"
%>