Advertisement
6_2008-2009 String Manipulation #206247

Deal With Apostrophes in SQL Statement

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

AI

ИИ-обзор: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Исходный код
original-source
<%
'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 & "')"
%>
Upload
Оригинальные комментарии (3)
Восстановлено из Wayback Machine