Is it ok to open/close several times an ADO connection?

  • Thread starter Thread starter The Dude
  • Start date Start date
T

The Dude

Hi guys,

I had a quick question regarding programming etiquette:

I have a table of about 100 adresses to match in a 500.000 records table. In
order to make the recordset smaller I obviously want to filter the big table,
by ZIP code for this example.
I have tried a recordset.filter method once opened but I can't make it work,
so instead I use an SQL filter while opening the connection... something like
"Select * From
Where ZipCode Between XX000 and XX999".

It makes the whole algorithm MUCH faster, but it makes me open and close the
connection each time I move to the next address to match (that is from 10 to
500 times in the same procedure).
Would that be a problem of any kind? It is a single user table, on my local
drive, but would it be a problem with a multi user database?

Thanks for this AMAZING forum. You guys rule.
T_D
 
ok cool
thanks Alex

Alex Dybenko said:
Hi,
do not see any problem with this. Also in most cases filtering with SQL,
like you do, is faster the filtering with recordset

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


The Dude said:
Hi guys,

I had a quick question regarding programming etiquette:

I have a table of about 100 adresses to match in a 500.000 records table.
In
order to make the recordset smaller I obviously want to filter the big
table,
by ZIP code for this example.
I have tried a recordset.filter method once opened but I can't make it
work,
so instead I use an SQL filter while opening the connection... something
like
"Select * From
Where ZipCode Between XX000 and XX999".

It makes the whole algorithm MUCH faster, but it makes me open and close
the
connection each time I move to the next address to match (that is from 10
to
500 times in the same procedure).
Would that be a problem of any kind? It is a single user table, on my
local
drive, but would it be a problem with a multi user database?

Thanks for this AMAZING forum. You guys rule.
T_D
 
Back
Top