When to close a result set (ODBC core question)

I am working on a small project for a local firm, and the following code works on my machine, but it creates errors on its server. I currently do not have access to this server, and this is not a field that I know a lot about, so I have to ask you guys.

The page is written in classic ASP (javascript for scripts). The logic is as follows:

conn.Open("myconnection");
bigQuery = "...";
rs = conn.execute(bigQuery);
while (!rs.eof) {
    ...
    smallQuery = "..."
    rssmall = conn.execute(smallQuery);
    ...
    rssmall.close();
    ...
    rs.movenext();
}
rs.close();
conn.close();

As I said, this works fine on my machine, but it returns some error (the worst thing is that I don’t even know what the error is) on the company server if bigQuery returns more than 20 lines . Something is wrong with my code (it really is not my field, but I think it is normal to collect data in a loop like this?), Or something is wrong with their IIS server.

Thank.

: : Access. :

conn=Server.CreateObject("ADODB.Connection");
conn.Provider="Microsoft.Jet.OLEDB.4.0";
conn.Open("D:/db/testingDb.mdb");

, . , .

+1
2

ASP, , ( , , ), , . , "" , . , , -

conn.Open("myconnection");
conn2.Open("myconnection")

bigQuery = "...";
rs = conn.execute(bigQuery);
while (!rs.eof) {
    ...
    smallQuery = "..."
    rssmall = conn2.execute(smallQuery);
    ...
    rssmall.close();
    ...
    rs.movenext();
}
rs.close();
conn2.close();
conn.close();
+2

?

Windows Server Jet 4.0 64- , , 64- . 32 , .

, , .

, :

<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open("D:/db/testingDb.mdb")

Response.Write("Database Opened OK")

conn.Close()

%>

, Database Opened OK, , , .

, , 32 .

, , , Open(), (, ), , ADODB , , , .

Edit

, . ASP script ,

On Error Resume Next

, , ,

If Err <> 0 Then
    Response.Write(Err.Number & " - " & Err.Description)
End If

. ASP 101 ASP VBScript

+2

Source: https://habr.com/ru/post/1777526/


All Articles