Solved

ODBC and Database Access

Posted on 1998-06-12
11
202 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle global variables 4 76
URL for downloading Google Chrome for Win XP 2 182
control image tags in a string ? 12 141
Base1 Encode/Decode 3 81
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

809 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