Solved

ODBC and Database Access

Posted on 1998-06-12
11
196 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

9 Experts available now in Live!

Get 1:1 Help Now