?
Solved

ODBC and Database Access

Posted on 1998-06-12
11
Medium Priority
?
206 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
[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
  • 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
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.

 

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 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

649 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