Case 2
' inserimento
Name = request.form("Name")
City = request.form("City")
State = request.form("State")
Country = request("Country")
set conn = server.createobject("adodb.connection")
conn.open "kathi"
SQLstmt = "INSERT INTO Sample (Name,City,State,Country)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & Name & "',"
SQLstmt = SQLstmt & "'" & City & "',"
SQLstmt = SQLstmt & "'" & State & "',"
SQLstmt = SQLstmt & "'" & Country & "'"
SQLstmt = SQLstmt & ")"
Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript Errors Occured:" & ""
response.write "Error Number=" & err.number & "
"
response.write "Error Descr.=" & err.description & "
"
response.write "Help Context=" & err.helpcontext & "
"
response.write "Help Path=" & err.helppath & "
"
response.write "Native Error=" & err.nativeerror & "
"
response.write "Source=" & err.source & "
"
response.write "SQLState=" & err.sqlstate & "
"
end if
IF conn.errors.count> 0 then
response.write "Database Errors Occured" & "
"
response.write SQLstmt & "
"
for counter= 0 to conn.errors.count
response.write "Error #" & conn.errors(counter).number & "
"
response.write "Error desc. -> " & conn.errors(counter).description & "
"
next
else
response.write ""
response.write "The record has been added."
response.write ""
response.write "View All Records
"
end if
Conn.Close
set conn=nothing
set rs = nothing
End Select