Solved

ODBC and Database Access

Posted on 1998-06-12
11
201 Views
Last Modified: 2010-04-04
I am writing a program where the user connects to a database via ODBC.  When the program starts the user selects the ODBC driver that he\she wishes to use.  Is there a way to find out which database the user has connected to ?  This would be very useful for the program.
0
Comment
Question by:johnclarke
  • 3
  • 3
  • 3
  • +1
11 Comments
 

Expert Comment

by:evansj
ID: 1352475
What type of database are you connecting to? SQL or desktop?
0
 

Author Comment

by:johnclarke
ID: 1352476
The program will be connecting to SQL databases.

0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1352477
You mean the Alias Name in the BDE or the Database itself like Oracle, Informix etc.?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:johnclarke
ID: 1352478
I mean the Database Name (eg Oracle, Informix, etc).
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1352479
What initial parameters you have, the Alias Name?
0
 

Author Comment

by:johnclarke
ID: 1352480
At the moment I am using the BDE which means that I have to use an alias name.  However,  I might decide to use the ODBC access components that are made by ODBCExpress since direct access to ODBC must be quicker than access via the BDE.
I would be grateful for any advice offered regarding either of the above methods for accessing databases via ODBC.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1352481
You can use TDatabase.DriverName
0
 

Accepted Solution

by:
KirkGray earned 50 total points
ID: 1352482
For a list of installed alias's Use GetAliasNames (or something similiar - Method of Session or Database Component).

To get a list of Just ODBC DSN's Use the ODBC32.dll DataSources function.....or have a poke around in the registry..... But I reconmend the first way..

0
 

Expert Comment

by:evansj
ID: 1352483
If you are using the BDE then check the native drivers under the native section in the BDE Admin. This provides direct access that's faster than ODBC.
0
 

Expert Comment

by:KirkGray
ID: 1352484
In retospect my answer is off the mark.  I am unsure how to get the database you have connected to using ODBC.  But ODBC32.dll would probably have a function somewhere that would help.
0
 

Expert Comment

by:evansj
ID: 1352485
Just create an ODBC data source and select then DSN inside the data aware control under database.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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