 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Phantom23 Guest
|
Posted: Tue Sep 14, 2004 4:35 pm Post subject: How do I get the "true" database name? |
|
|
I need to get the actual database name on a server that I am connecting to
through an ODBC alias.
For example...
-- on an MS SQL database server named "MyServer"
-- there exists 3 databases.... FirstDB, SecondDB, and ThirdDB
-- Through ODBC I setup 3 aliases, Alias1, Alias2, and Alias3.
-- Using the BDE... make a connection to Alias1
-- How can I get the databasename = FirstDB (which is what Alias1 points
to)?
Need to do this for MS SQL, DB2, Sybase SQL Server, Oracle, etc. -- just all
of them.
How can I get this?
Syntax specific SQL statement for each database?
Delphi function?
If it is different for ADO, then I need to get it for that too?
Thanks in advance,
Samson
|
|
| Back to top |
|
 |
George Guest
|
Posted: Mon Sep 27, 2004 4:36 am Post subject: Re: How do I get the "true" database name? |
|
|
Samson,
Try to read the ODBC registry entries in
HKEY_LOCAL_MACHINESoftwareODBCODBC.INIODBC Data Sources.
All aliases are defined there, and their specifics are in
HKEY_LOCAL_MACHINESoftwareODBCODBC.INI.
Hope this helps.
George
"Phantom23" <Ghost (AT) Email (DOT) com> wrote
| Quote: |
I need to get the actual database name on a server that I am connecting to
through an ODBC alias.
For example...
-- on an MS SQL database server named "MyServer"
-- there exists 3 databases.... FirstDB, SecondDB, and ThirdDB
-- Through ODBC I setup 3 aliases, Alias1, Alias2, and Alias3.
-- Using the BDE... make a connection to Alias1
-- How can I get the databasename = FirstDB (which is what Alias1 points
to)?
Need to do this for MS SQL, DB2, Sybase SQL Server, Oracle, etc. -- just
all
of them.
How can I get this?
Syntax specific SQL statement for each database?
Delphi function?
If it is different for ADO, then I need to get it for that too?
Thanks in advance,
Samson
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|