Board index » delphi » Getting a DB name from an Alias name

Getting a DB name from an Alias name

I need to get the database name from a given alias name. We have a three tier
database system which each layer on a different machine (client, application-
server and database).

The database machine is running SQL Server. On the application sever I need to
access the BDE (ver 4.5) to get the name of a physical database when given an
alias name. I know the information is held in the IDAPI32.cfg file on the
machine and I have tried most of the BDE API calls to try to access the
information but nothing seems to work.

DbiGetDatabaseDec, DbiOpenDatabaseList with DbiGetProps & DbiGetCursorProps
etc. all seem to return everything but what I need. Has anyone had any
problems with this? Please [gets down on knees and begs] can someone help?

Thanks in advance,
James

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:Getting a DB name from an Alias name


Arise young man.  I believe the TSession component will help. I use it like
:

   gs_database := session.getaliasdrivername('MYALIAS');
   if gs_database = 'ORACLE' then
   begin  
      blah, blah

There are about 14 million methods that return everthing from soup to nuts.
The method
procedure GetAliasParams(const AliasName: string; List: TStrings);
looks promising.

...Peter

james...@my-dejanews.com wrote in article
<7294nl$45...@nnrp1.dejanews.com>...

Quote
> I need to get the database name from a given alias name. We have a three
tier
> database system which each layer on a different machine (client,
application-
> server and database).

> The database machine is running SQL Server. On the application sever I
need to
> access the BDE (ver 4.5) to get the name of a physical database when
given an
> alias name. I know the information is held in the IDAPI32.cfg file on the
> machine and I have tried most of the BDE API calls to try to access the
> information but nothing seems to work.

> DbiGetDatabaseDec, DbiOpenDatabaseList with DbiGetProps &
DbiGetCursorProps
> etc. all seem to return everything but what I need. Has anyone had any
> problems with this? Please [gets down on knees and begs] can someone
help?

> Thanks in advance,
> James

> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own  

Other Threads