More than 1 recordset

Results 1 to 2 of 2

Thread: More than 1 recordset

  1. #1
    Jean Withers Guest

    Default More than 1 recordset

    Can I have more than one recordset generated by the &#039once-declared&#039 connection?<BR><BR>I&#039m getting an error message:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Could not use &#039(unknown)&#039; file already in use. <BR><BR>pointing to the opening of the 2nd recordset, which is nested within operations on 1st recordset. <BR><BR>Thanks in advance, Jean Withers Code below:<BR><BR> set rs=Server.CreateObject("adodb.Recordset")<BR> conn="JJignet"<BR> sqlstmt = "SELECT * from Cards"<BR> sqlstmt, conn<BR> &#039if recordset empty then quit with msg else display<BR> If rs.eof then<BR> response.write "&#060;center&#062;There are no records in the database"<BR> response.end<BR> Else<BR> Do while not rs.eof<BR> nodeID=rs("NodeID")<BR> ID = rs("CardID")<BR> cardType = rs("CardType")<BR> rel = rs("CardRel")<BR> shelf = rs("Shelf")<BR> slot = rs("Slot")<BR> code = rs("Code")<BR> prot = rs("ProtBy")<BR> <BR> Set rs2=Server.CreateObject("ADODB.Recordset")<BR> SQLstmt2="SELECT Name FROM Nodes WHERE NodeID=" & NodeID & ";"<BR> rs2.Open SQLstmt2,conn<BR> nodeName=rs2("Name")<BR> %&#062;<BR> This line checks if nodeName is coming through<BR><BR> nodeName=&#060;%=Name%&#062;<BR> &#060;%<BR> rs.MoveNext<BR> loop <BR> End If<BR>%&#062;<BR>

  2. #2
    Bart Beekhuizen Guest

    Default RE: More than 1 recordset

    conn="JJignet"<BR>This is I think not very well.<BR><BR>This is your connection. So:<BR><BR>Set objConn = Server.CreateObject ("ADODB.Connection")<BR>strConnect = "DRIVER={Microsoft Access Driver _(*.mdb)};DBQ=f:inetpubwwwrootfpdbmuzbeheer2.mdb"< BR>objConn.Open "DSN=Live" (&#060;-- or instead strConnect)<BR><BR>But this DSN or the connectionsring is important. Then you can open as much recordsets as you want because then a connection is made<BR><BR>Regards,<BR><BR>Bart Beekhuizen<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts