HI,
The best way I have found is to create a .udl file that sits in a shared
folder and points to your data source (any OLEDB provider)
In a class you use "File Name=F:\MyUDL.udl" in the connection.Open command.
Now you keep and use that connection object for all your code.
The beauty of this system is that all users point to this location (provide
a browse capability to find it) and when you move from a test db to your
production db then double-click the .udl file to open it and change the
database. Automatically every user from then on will be pointed to the new
database - seamlessly.
To make the udl file work with an Access Project see article: 305388 in
Microsoft's knowledgebase. There are links to more good articles at the
bottom of this one.
--
Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit
www.projectlearning.com/