I posted this last friday and some good folks tried to help.
It is still not working.,
I am basically trying to insert data into both the driver table and the police table.
Data gets inserted correctly into the driver table but nothing is inserting into the police table.
I can't figure this out.
Below is the entire code.
thanks in advance::
<%@ Language=VBScript%>
<%Response.buffer=true%>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Set connectionToDatabase=Server.CreateObject("ADODB.Connection"
Set recordSet=Server.CreateObject("ADODB.Recordset"
connectionToDatabase.Open "DSN=janise"
recordSet.Open "SELECT * FROM Driver",connectionToDatabase,3,3
Dim ss_nbr, fname, validate
validate=true
for each qryItem in Request.Form
if Request.Form(qryItem) = "" Then
validate = false
Response.Write("Missing : " & qryItem & "<BR>"
End if
next
if not validate then
Response.Write("<body bgcolor=steelblue><BR><font color=red><h3><b>" &_
"Please click the back button and complete the missing fields. " &_
"Thank You</b></h3></font></body> "
else
recordSet.AddNew
recordSet("DriverID"
= Request.Form("SS_NUM"
recordSet("lname"
= Request.Form("LAST_NAME"
recordSet("fname"
= Request.Form("FIRST_NAME"
recordSet("MI"
= Request.Form("Middle_Initial"
recordSet("DriverGender"
= Request.Form("Driver_Sex"
recordSet("Address1"
= Request.Form("Address1"
recordSet("Address2"
= Request.Form("Address2"
recordSet("CityAdd"
= Request.Form("City"
recordSet("StateAdd"
= Request.Form("STATE"
recordSet("ZipAdd"
= Request.Form("ZIP_CODE"
recordSet("PhoneHome"
= Request.Form("Home_Phone"
recordSet("PhoneWork"
= Request.Form("Work_Phone"
recordSet("EmailAdd"
= Request.Form("Email_Address"
recordSet("Result"
= Request.Form("reason"
recordSet("drugTest"
= Request.Form("drugTest"
recordSet("atFault"
= Request.Form("atFault"
recordSet("DriverCond"
= Request.Form("DriverCond"
recordSet("InjuryType"
= Request.Form("InjuryType"
recordSet("WeatherType"
= Request.Form("WeatherCond"
recordSet.Update
connectionToDatabase.Close
Set connectionToDatabase=Nothing
if Request.Form("CoApp"
= "NO" Then
Response.Redirect "co_applicant.asp?ss_nbr=" & Request.Form("SS_NUM"
else
Response.Redirect "new_rec.asp"
end if
end if
%>
<%
'Set recordSet=Server.CreateObject("ADODB.Recordset"
Set recordSet2=Server.CreateObject("ADODB.Recordset"
recordSet2.Open "SELECT * FROM Police",connectionToDatabase,3,3
for each qryItem in Request.Form
if Request.Form(qryItem) = "" Then
validate = false
Response.Write("Missing : " & qryItem & "<BR>"
End if
next
if not validate then
Response.Write("<body bgcolor=steelblue><BR><font color=red><h3><b>" &_
"Please click the back button and complete the missing fields. " &_
"Thank You</b></h3></font></body> "
else
recordSet2.AddNew
recordSet2("PoliceID"
= Request.Form("code"
recordSet2("offFname"
= Request.Form("F_NAME"
recordSet2("offLname"
= Request.Form("L_NAME"
recordSet2("AccidentType"
= Request.Form("acType"
recordSet2.Update
recordSet2.Close
Set recordSet2 = Nothing
end if
%>
</body>
</html>
It is still not working.,
I am basically trying to insert data into both the driver table and the police table.
Data gets inserted correctly into the driver table but nothing is inserting into the police table.
I can't figure this out.
Below is the entire code.
thanks in advance::
<%@ Language=VBScript%>
<%Response.buffer=true%>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Set connectionToDatabase=Server.CreateObject("ADODB.Connection"
Set recordSet=Server.CreateObject("ADODB.Recordset"
connectionToDatabase.Open "DSN=janise"
recordSet.Open "SELECT * FROM Driver",connectionToDatabase,3,3
Dim ss_nbr, fname, validate
validate=true
for each qryItem in Request.Form
if Request.Form(qryItem) = "" Then
validate = false
Response.Write("Missing : " & qryItem & "<BR>"
End if
next
if not validate then
Response.Write("<body bgcolor=steelblue><BR><font color=red><h3><b>" &_
"Please click the back button and complete the missing fields. " &_
"Thank You</b></h3></font></body> "
else
recordSet.AddNew
recordSet("DriverID"
recordSet("lname"
recordSet("fname"
recordSet("MI"
recordSet("DriverGender"
recordSet("Address1"
recordSet("Address2"
recordSet("CityAdd"
recordSet("StateAdd"
recordSet("ZipAdd"
recordSet("PhoneHome"
recordSet("PhoneWork"
recordSet("EmailAdd"
recordSet("Result"
recordSet("drugTest"
recordSet("atFault"
recordSet("DriverCond"
recordSet("InjuryType"
recordSet("WeatherType"
recordSet.Update
connectionToDatabase.Close
Set connectionToDatabase=Nothing
if Request.Form("CoApp"
Response.Redirect "co_applicant.asp?ss_nbr=" & Request.Form("SS_NUM"
else
Response.Redirect "new_rec.asp"
end if
end if
%>
<%
'Set recordSet=Server.CreateObject("ADODB.Recordset"
Set recordSet2=Server.CreateObject("ADODB.Recordset"
recordSet2.Open "SELECT * FROM Police",connectionToDatabase,3,3
for each qryItem in Request.Form
if Request.Form(qryItem) = "" Then
validate = false
Response.Write("Missing : " & qryItem & "<BR>"
End if
next
if not validate then
Response.Write("<body bgcolor=steelblue><BR><font color=red><h3><b>" &_
"Please click the back button and complete the missing fields. " &_
"Thank You</b></h3></font></body> "
else
recordSet2.AddNew
recordSet2("PoliceID"
recordSet2("offFname"
recordSet2("offLname"
recordSet2("AccidentType"
recordSet2.Update
recordSet2.Close
Set recordSet2 = Nothing
end if
%>
</body>
</html>