View Single Post
  #3 (permalink)  
Old April 17th, 2007, 09:15 AM
dalezjc dalezjc is offline
Authorized User
Points: 150, Level: 2
Points: 150, Level: 2 Points: 150, Level: 2 Points: 150, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2006
Location: Colorado Springs, CO
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Here's my complete piece of code:

Dim lastname, firstname, grade, data_source, con, rsinsert, Conn

Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "'")
End Function

lastname = ChkString(Request.Form("lastname"))
firstname = ChkString(Request.Form("firstname"))
grade = ChkString(Request.Form("grade"))
set Conn=Server.CreateObject("ADODB.Connection")
set rsInsert = server.CreateObject("ADODB.Recordset")
Conn.open "Driver={SQL Server}; Server=server;Database=db;UID=x;PWD=x;"
set rsInsert = conn.Execute ("INSERT INTO user (lastname, firstname, grade) values ('" & lastname & "', '" & firstname & "', '" & grade & "' ")


con.Close
Set con = Nothing

I'm not sure what you mean by doing a response.write of the SQL statement.

Reply With Quote