Search Tools Links Login

Deal With Apostrophes in SQL Statement


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

Original Author: WebFFiliates

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 & "')"
%>

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 77 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.