Joe Overman
asked on
checking for a specific ODBC connection
I need a way to check for an existing ODBC connection in the odbc data source administrator. All the research I have done indicates that the values are stored in either the INI file (not in XP) or the registry. I have determined that the ini file does not exist and I do not have access to the registry on this computer so my search skills are limited here. What I would like an easy way to see if the the connection named "tempconn" exists in the registry so that my code does not update the connection information when I use RegisterDatabase to establish the missing connection. This is all being done on an xp system (soon to be vista) inside a ms access database.
What code are you currently using, r u using the sqlconfig... api? if so then could you not try to open as edit. If it failed then try to add on. If that fails then summat is knackered or it already exists!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> the ini file does not exist and I do not have access to the registry on this computer ..
Then you are left with trial and error.
Open a connection assuming your DSN exists. Catch an error.
If no error is catched, the DSN exists.
/gustav
Then you are left with trial and error.
Open a connection assuming your DSN exists. Catch an error.
If no error is catched, the DSN exists.
/gustav
ASKER
That is just what I need. Thanks