<%
'Check to see if this is the first time the page has been loaded.
'If there is data to be processed, this section will execute.
If Request.ServerVariables("Content_Length")>0 Then
If "Insert" = Request("ActionType") Then
' Create a connection to the database.
Set DataConn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.RecordSet")
DataConn.Open "DBQ=" & Server.Mappath("cdemo.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
'Open the record table and then insert the record.
RS.Open "tblContact", DataConn, adOpenKeyset, adLockOptimistic
RS.AddNew
RS("Name") = Request("Name")
RS("Address") = Request("Address")
RS("email") = Request("email")
RS("Phone") = Request("Phone")
RS("Comments") = Request("Comments")
RS.Update
'Cleanup - Close database connection.
RS.Close
DataConn.Close
' Send text to the user to know they have completed the
' process with no errors. Sever will display errors fatal errors.
Response.Write "