G
Guest
I have an Access 97 app split into a FE and BE. I have the following code in
a module to get the next available ID number.
Dim db as DAO.Database
Dim rs as DAO.Recordset
set db = CurrentDb()
set rs = db.OpenRecordset("SELECT Max(ID) AS MaxNumber FROM
tblCategoryDetails WHERE ID <= 1000000;")
It takes approx 40 secs for this recordset to open. If I remove the WHERE
clause, the recordset opens in 1 sec. Why does adding the WHERE clause add
so much time? I really need this on the query because I have another one
that uses WHERE ID > 1000000 depending on different circumstances.
Thanks for your help!
a module to get the next available ID number.
Dim db as DAO.Database
Dim rs as DAO.Recordset
set db = CurrentDb()
set rs = db.OpenRecordset("SELECT Max(ID) AS MaxNumber FROM
tblCategoryDetails WHERE ID <= 1000000;")
It takes approx 40 secs for this recordset to open. If I remove the WHERE
clause, the recordset opens in 1 sec. Why does adding the WHERE clause add
so much time? I really need this on the query because I have another one
that uses WHERE ID > 1000000 depending on different circumstances.
Thanks for your help!