I have this database, MS Access front end on a SQL database (SQL Express server) with an ODBC-connnection. Everything runs quite nice - even thought the connection to the SQL-server is bad (bad network, cannot fix), however I have one problem/challenge.
Backend used to be Access, but I'm connecting the client to SQL now. In most cases I use DAO (because the client was running on Access-backend before) to get recordsets, but while connecting to SQL I'm sometimes switching to ADODB, mostly because of speed
I have this procedure that needs to update records based on the IDs that are provided by another query
so:
The table holds only 5000 records. When running the code it takes more than a minute (or two!) to do the .filter which is ridiculous :banghead:
Now, I'm not an export but I know it's often better to just do
and this works, but it still kinda slow (takes around 1,5sec per record, which can take a while when updating 10+ records) so I'm looking for the most efficient way to do this (ADODB, DAO, maybe execute "UPDATE" SQL)
It's just that I cannot believe how slow the first option is (.filter)
, I'm thinking I'm just doing something wrong. :banghead:
Of course, the actual situation in my DB is a bit more complex, but I think I have described the most important things.
Anybody have any thoughts? Is using rstADODB.filter something to avoid altogether?
Maybe this option doesn't work properly when using it on a slow network (2Mb/s from PC to SQL-server, which is just what I'm stuck with here, companynetwork)
Backend used to be Access, but I'm connecting the client to SQL now. In most cases I use DAO (because the client was running on Access-backend before) to get recordsets, but while connecting to SQL I'm sometimes switching to ADODB, mostly because of speed
I have this procedure that needs to update records based on the IDs that are provided by another query
so:
Code:
set rst1 currentdb.openrecordset("select ID from table where .. ") 'DAO
rst2.open "select ID, field1 from table"
do while not rst1.eof
rst2.filter = "ID=" & rst1!ID
if not rst2.eof then rst2.field1=now()
end if
Now, I'm not an export but I know it's often better to just do
Code:
set rst1 currentdb.openrecordset("select ID from table where .. ") 'DAO
do while not rst1.eof
rst2.open "select ID, field1 from table where ID=" & rst1!ID
if not rst2.eof then rst2.field1=now()
end if
It's just that I cannot believe how slow the first option is (.filter)

Of course, the actual situation in my DB is a bit more complex, but I think I have described the most important things.
Anybody have any thoughts? Is using rstADODB.filter something to avoid altogether?
Maybe this option doesn't work properly when using it on a slow network (2Mb/s from PC to SQL-server, which is just what I'm stuck with here, companynetwork)