Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This ASP snippet shows how to prevent errors in SQ...
Author:
John Freedman
Submitted:
10/12/2000
Version:
ASP
Compatibility:
ASP
Category:
ASP
Views:
23088
This ASP snippet shows how to prevent errors in SQL queries containing an apostrophe.
Declarations:
'none
Code:
<% Set conn = Server.CreateObject("ADODB.Connection")conn.Open "DSN=EmpInfo" strSQL = "INSERT INTO tblEmp (FirstName,LastName,Email,Phone) VALUES ('" & _ Replace(Request.Form("FirstName"),"'","''") & "','" & _ Replace(Request.Form("LastName"),"'","''") & "','" & _ Request.Form("Email") & "','" & _ Request.Form("Phone") & "')" conn.Execute(strSQL) %>
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement