I recently had a very strange problem. The application is written in classic ASP, but I think this is the same case for every connection using ADO / OLEDB.
These are the connection parameters.
conn=Server.CreateObject("ADODB.Connection");
conn.Provider="Microsoft.Jet.OLEDB.4.0";
conn.Open("D:/db/testingDb.mdb");
In short, this code:
conn.Open("myconnection");
bigQuery = "...";
rs = conn.execute(bigQuery);
while (!rs.eof) {
...
smallQuery = "..."
rssmall = conn.execute(smallQuery);
...
rssmall.close();
...
rs.movenext();
}
rs.close();
conn.close();
It does not work if bigQuery returns more than a certain number of rows (in my case ~ 20). But if I use another connection for the inner loop, for example stealthyninja:
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();
The problem disappears.
I use an Access database and IIS7, if that matters.
Does anyone have a logical explanation?
Klark source
share