Using a Confiuration File or Registry to Store ADO Connection String

  • Thread starter Thread starter Mark Holahan
  • Start date Start date
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,
 
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
 
Back
Top