Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting DSN details at run time using VB6

Posted on 2000-03-15
4
Medium Priority
?
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

704 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