Solved

Getting DSN details at run time using VB6

Posted on 2000-03-15
4
257 Views
Last Modified: 2010-08-05
Given a system DSN, how can I obtain
the specific SQL Server (or other)
database that that has been mapped to ,
from VB at runtime.
0
Comment
Question by:josereyes
  • 2
4 Comments
 
LVL 12

Expert Comment

by:roverm
ID: 2619231
Use the ODBCTool DLL. Set a reference to it and instantiate it.

D'Mzzl!
RoverM
0
 

Author Comment

by:josereyes
ID: 2619388
Sorry but ODBCTools hasn't got that feature.

All it has is CreateDSN,GetDataSourceList and GetODBCDriverList.

I want to specify a DSN and get back the
associated driver and database that it
was mapped to - having set it via
Control Panel outside of VB


0
 
LVL 4

Accepted Solution

by:
gencross earned 50 total points
ID: 2622159
You can get this info from the registry.  User DSN's are stored in HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\[DSN Name].

System DSN's are stored in. HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\[DSN Name].

All the info you want is under these keys.





0
 

Author Comment

by:josereyes
ID: 2623024
Thanks gencross
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now