BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I get the "true" database name?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Phantom23
Guest





PostPosted: Tue Sep 14, 2004 4:35 pm    Post subject: How do I get the "true" database name? Reply with 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
George
Guest





PostPosted: Mon Sep 27, 2004 4:36 am    Post subject: Re: How do I get the "true" database name? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.