<%@ Language=VBScript %> <% Option Explicit Response.Expires = 0 ' ***************************** ' Variable Declarations ' ***************************** ' Strings Dim SQL ' Integers & Numerics ' Objects Dim cn, rs ' Other ' ***************************** ' Initialize Variables ' ***************************** %> Insert using SPT (SQL pass-thru) <% If Request.Form("TextCol") = "" Then %>

<% Else Set cn = Server.CreateObject("ADODB.Connection") cn.Open Application("guestDSN") SQL = "INSERT INTO pubs..paulen (TextCol) " SQL = SQL & " VALUES ('" & padQuotes(Request("TextCol")) & "')" cn.Execute SQL Response.Write "Inserted:
" & Request("TextCol") End If %>

<% Function padQuotes( instring ) REM This Function pads an extra Single q ' uote in strings containing quotes for REM proper SQL searching. Dim bodybuild Dim bodystring Dim Length Dim i bodybuild = "" bodystring = instring Length = Len(bodystring) For I = 1 To length bodybuild = bodybuild & Mid(bodystring, I, 1) If Mid(bodystring, I, 1) = Chr(39) Then bodybuild = bodybuild & Mid(bodystring, I, 1) End If Next bodystring = bodybuild padQuotes = bodystring End Function %>