IMHO, you're going about this the wrong way. If the SQL is supposed to work with a particular database, the code should used a fully-qualified database name; not simply work with whatever 'production' database the user has open.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|