"Ed Robichaud" <ed*********@wdn.com> wrote in
news:Nz*******************@monger.newsread.com:
<ca******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Hi,
Is it possible to pase the name of the database as a variable
inside a Parameter Query?
Parameter [MyDatabase] text;
Select * from [MyDatabase;
Not sure why you'd ever need that, as Access can only have one
database open at a time. You can link to a large number of tables
in a large number of other databases, but their reference location
will always be the single database that is currently open.
No, it can't be done with a parameter.
But having multiple linked tables is not a terribly useful way to do
it, either, as you then have to change your recordsources on the fly
to point to one linked table or another. In that case, you might as
well have multiple saved queries. But again, you have to change
recordsources at runtime.
So, you're doing that, you might as well write code to write SQL
that includes the connection string to the appropriate back end.
And I don't think it's at all an uncommon thing. I've used it a lot.
Of course, I also don't use much in the way of parameter queries.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc