Using a Confiuration File or Registry to Store ADO Connection String

M

Mark Holahan

Hi,

Is it possible, in an Access ADP, to use a configuration file or the
registry to store your ADO connection string parameters? If so, how do
reference either the config file or the registry w/in Access? Is there a
better way to create a dynamic connection string? Say the Data Link API
Reference?

Many thanks,
 
C

Chris Newman

You can use the Windows API and use the Registry functions. Search on
vbcode.com for the code, just cut'n'paste into a new module in Access. Its
got instructions and an example i think on how to use it. This will let you
store the data in the registry and retreive it.

As for the connection string do:

Application.CurrentProject.CloseConnection()
Application.CurrentProject.BaseConnectionString = string from the registry
Application.CurrentProject.Open()

I think this is right from memory!

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top