I've tried leaving the connection open, and closing it later, I've tried grouping, I've a couple different methods for the insert multiple records part.
The first part inserts great, the second it either looks like it's inserting or I get open errors.
<%
Dim MyConn, RS, fldSurveyID, fldSalesPerson, fldVehicle, fldCableYes, fldRadio, fldStation, fldComment1, fldComment2
fldSurveyID = Session("svSurveyID"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldSalesPerson = Request.Form("fldSalesPerson"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldVehicle = Request.Form("fldVehicle"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldCableYes = Request.Form("fldCableYes"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldRadio = Request.Form("fldRadio"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldStation = Request.Form("fldStation"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldComment1 = Request.Form("fldComment1"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
fldComment2 = Request.Form("fldComment2"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Set MyConn=Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Set RS = Server.CreateObject("ADODB.RecordSet"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
MyConn.Open "dbAdvertising"
RS.Open "Select * From tblEntries",MyConn,adOpenDynamic,adLockPessimistic,adCMDText
RS.AddNew
RS("fldSurveyID"
=fldSurveyID
RS("fldSalesPerson"
=fldSalesPerson
RS("fldVehicle"
=fldVehicle
RS("fldCableYes"
=fldCableYes
RS("fldRadio"
=fldRadio
RS("fldStation"
=fldStation
RS("fldComment1"
=fldComment1
RS("fldComment2"
=fldComment2
RS.Update
RS.Close
MyConn.Close
%>
<%
Dim RS2, i, strQuery, fldSurveySOB
Set RS2 = Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
MyConn.Open "dbAdvertising"
RS2.Open "Select * From tblSurveySOB",MyConn,adOpenDynamic,adLockPessimistic,adCMDText
RS2.BeginTrans
for i=1 to 8
fldSurveyID = Request.Form("fldSurveyID"&i)
fldSurveySOB = Request.Form("fldSurveySOB"&i)
strQuery = "INSERT INTO tblSurveySOB ([fldSurveyID],[fldSurveySOB]) VALUES (" _
& "'" & fldSurveyID & "', " _
& "'" & fldSurveySOB & "
"
'Response.Write strQuery & "<br>"
rs2.Execute strQuery
NEXT
IF rs2.Errors.Count = 0 THEN
rs2.CommitTrans
ELSE
rs2.RollbackTrans
insertcount = 0
END IF
%>
<%
RS2.Close
MyConn.Close
Set rs = nothing
Set rs2 = nothing
Set MyConn = Nothing
%> "Insert witty remark here"
Stuart
The first part inserts great, the second it either looks like it's inserting or I get open errors.
<%
Dim MyConn, RS, fldSurveyID, fldSalesPerson, fldVehicle, fldCableYes, fldRadio, fldStation, fldComment1, fldComment2
fldSurveyID = Session("svSurveyID"
fldSalesPerson = Request.Form("fldSalesPerson"
fldVehicle = Request.Form("fldVehicle"
fldCableYes = Request.Form("fldCableYes"
fldRadio = Request.Form("fldRadio"
fldStation = Request.Form("fldStation"
fldComment1 = Request.Form("fldComment1"
fldComment2 = Request.Form("fldComment2"
Set MyConn=Server.CreateObject("ADODB.Connection"
Set RS = Server.CreateObject("ADODB.RecordSet"
MyConn.Open "dbAdvertising"
RS.Open "Select * From tblEntries",MyConn,adOpenDynamic,adLockPessimistic,adCMDText
RS.AddNew
RS("fldSurveyID"
RS("fldSalesPerson"
RS("fldVehicle"
RS("fldCableYes"
RS("fldRadio"
RS("fldStation"
RS("fldComment1"
RS("fldComment2"
RS.Update
RS.Close
MyConn.Close
%>
<%
Dim RS2, i, strQuery, fldSurveySOB
Set RS2 = Server.CreateObject("ADODB.Connection"
MyConn.Open "dbAdvertising"
RS2.Open "Select * From tblSurveySOB",MyConn,adOpenDynamic,adLockPessimistic,adCMDText
RS2.BeginTrans
for i=1 to 8
fldSurveyID = Request.Form("fldSurveyID"&i)
fldSurveySOB = Request.Form("fldSurveySOB"&i)
strQuery = "INSERT INTO tblSurveySOB ([fldSurveyID],[fldSurveySOB]) VALUES (" _
& "'" & fldSurveyID & "', " _
& "'" & fldSurveySOB & "
'Response.Write strQuery & "<br>"
rs2.Execute strQuery
NEXT
IF rs2.Errors.Count = 0 THEN
rs2.CommitTrans
ELSE
rs2.RollbackTrans
insertcount = 0
END IF
%>
<%
RS2.Close
MyConn.Close
Set rs = nothing
Set rs2 = nothing
Set MyConn = Nothing
%> "Insert witty remark here"
Stuart