MLH <CRCI@NorthState.net> wrote in
news:aavv51pur6ml5pm2456d010o29od8n2871@4ax.com:
[color=blue][color=green]
>>You can't treat an attached table as table type recordset.
>>
>>Either
>> Open as a dynaset and ditch the seek
>>Or
>> change the line
>> Set MyDB = DBEngine.Workspaces(0).Databases(0)
>> to open the db the table is in
>> e.g.
>> Set MyDB = OpenDatabase("Path to the table containing db")[/color]
>
> Thanks, Terry. I really like the latter option. That way, I
> can use the SEEK method. That's a great idea! You are
> a genius![/color]
Why in the world do you need to use SEEK?
SEEK will only give a performance advantage when you *must* open the
entire table for navigation, and you need to jump around within that
table to locate data.
In the vast majority of cases, you need a particular value or set of
records, and in that case, it's vastly easier to use a dynaset and
use a WHERE clause to restrict the records returned to just what you
need. If you have multiple records, you can navigate with
..FindFirst/.FindNext. That operation is slower than SEEK, but
because save time (and resources) because you've retrieved far fewer
rows in the first place -- the net result is the same or faster than
the SEEK. Or, at least, it's close enough to make it not worth the
trouble of using SEEK.
I, for one, have never once used a SEEK, ever, in 10 years of Access
programming. Not even one time. And I can't think of a single
real-world scenario in any of the dozens of apps I've created where
SEEK would offer any kind of advantage that would be worth the
trouble of using it.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc