ADODB.Recordset problem

Results 1 to 3 of 3

Thread: ADODB.Recordset problem

  1. #1
    Join Date
    Dec 1969

    Default ADODB.Recordset problem

    I keep getting the error: "Operation is not allowed when the object is closed." I have a sql statement called SQLTest, and I want the results put into a recordset that I can page through.<BR>I don&#039;t know what&#039;s missing. I have this stuff:<BR>Set Connection = Server.CreateObject("ADODB.Connection")<BR>Connect ion.Open Session("ODBC_ConnectionString")<BR>SQLTest="selec t.....etc<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>RS.Open SQLTest,Connection

  2. #2
    Join Date
    Dec 1969

    Default Perhaps this will help

  3. #3
    LeeAnnie Guest

    Default RE: ADODB.Recordset problem

    ------------------------CUT HERE-------------------------<BR>&#039;put this in an include file so you only have to change it once in your website<BR><BR>&#060;!--#include file = "./"--&#062;<BR>&#060;%<BR>strDB= "provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:...db1.mdb;"<BR>set dbconn = Server.CreateObject("ADODB.Connection")<BR>dbConn. Open strDB<BR>%&#062;<BR><BR>--------------------------- CUT HERE ---------------------------<BR>&#060;%<BR>&#039;this goes in your regular code<BR>set RS = dbconn.execute("SELECT * FROM customer;",,adCmdText)<BR> do while not RS.EOF<BR> response.write(RS("name")&"<BR>")<BR> RS.Close<BR> set RS = nothing<BR><BR>dbconn.Close<BR>set dbconn = nothing<BR>%&#062;<BR><BR>-------------------------------------------------------------<BR><BR>Hope this gets you on your way.

Posting Permissions

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