Shouldn't the following statement return the current ClaimNo in the Cookie?
<%
Set cn = Server.CreateObject("ADODB.Connection"
Set rs = Server.CreateObject("ADODB.Recordset"
cn.ConnectionString = "Driver=SQL Server;uid=sa;pwd=;Server=TMSN_Server;database=Test"
cn.Open
sql = "Select * from VesselOwnerDB, VesselInfoDB where OnrAddress = '" & Request.Form("txtVloAddress"
& "'"
rs.Open sql, cn, 3, 3
If rs.BOF = True and rs.EOF = True Then
rs.AddNew
With rs
.Fields("UserID"
.Value = Request.Cookies("UserID"
.Fields("CltRefNo"
.Value = Request.Form("txtRefNo"
.Fields("OnrPolicyNo"
.Value = Request.Form("txtPolicyNo"
.Fields("OnrLastName"
.Value = Request.Form("txtVloLName"
.Fields("OnrFirstName"
.Value = Request.Form("txtVloFName"
.Fields("OnrAddress"
.Value = Request.Form("txtVloAddress"
.Fields("OnrCity"
.Value = Request.Form("txtVloCity"
.Fields("OnrStateProv"
.Value = Request.Form("txtVloStProv"
.Fields("OnrPostalCode"
.Value = Request.Form("txtVloPostalCode"
.Fields("OnrCountry"
.Value = Request.Form("txtVloCountry"
.Fields("OnrPhone1"
.Value = Request.Form("txtVloPhone1"
.Fields("OnrPhone2"
.Value = Request.Form("txtVloPhone2"
.Fields("OnrCell"
.Value = Request.Form("txtVloCell"
.Fields("OnrFax"
.Value = Request.Form("txtVloFax"
.Fields("OnrEMail"
.Value = Request.Form("txtVloEMail"
.Update
Response.Cookies("ClaimNo"
= rs.Fields("ClaimNo"
.Value
End With
Response.Redirect "VesselInfo.asp"
Else
rs.MoveFirst
Response.Write ("Already in Database!"
End If
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
%>
I need to do this to tie the Databases together. In the VesselOwnerDB and the VesselInfoDB the ClaimNo is the Primary Key and they are related in the relationship table. Do I need to go another way or what? Rob
Just my $.02.
<%
Set cn = Server.CreateObject("ADODB.Connection"
Set rs = Server.CreateObject("ADODB.Recordset"
cn.ConnectionString = "Driver=SQL Server;uid=sa;pwd=;Server=TMSN_Server;database=Test"
cn.Open
sql = "Select * from VesselOwnerDB, VesselInfoDB where OnrAddress = '" & Request.Form("txtVloAddress"
rs.Open sql, cn, 3, 3
If rs.BOF = True and rs.EOF = True Then
rs.AddNew
With rs
.Fields("UserID"
.Fields("CltRefNo"
.Fields("OnrPolicyNo"
.Fields("OnrLastName"
.Fields("OnrFirstName"
.Fields("OnrAddress"
.Fields("OnrCity"
.Fields("OnrStateProv"
.Fields("OnrPostalCode"
.Fields("OnrCountry"
.Fields("OnrPhone1"
.Fields("OnrPhone2"
.Fields("OnrCell"
.Fields("OnrFax"
.Fields("OnrEMail"
.Update
Response.Cookies("ClaimNo"
End With
Response.Redirect "VesselInfo.asp"
Else
rs.MoveFirst
Response.Write ("Already in Database!"
End If
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
%>
I need to do this to tie the Databases together. In the VesselOwnerDB and the VesselInfoDB the ClaimNo is the Primary Key and they are related in the relationship table. Do I need to go another way or what? Rob
Just my $.02.