Solved

Getting a list of BDE Aliases?

Posted on 1998-07-28
3
346 Views
Last Modified: 2010-04-03
Any BDE calls or sample code to get a list of all BDE aliases?  
Does the BDE automatically give the ODBC aliases also?  Or is that a seperate call?
(I have to get a list of both).

Thanks,
j
0
Comment
Question by:greendot
[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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1358799
Hi greendot,

look at the BDE help file :

Delphi Examples: DbiOpenDatabaseList

Return a list of of accessible databases and all aliases found in the configuration file.

This example uses the following input:
      fDbiOpenDatabaseList(DatabaseList);

procedure fDbiOpenDatabaseList(DatabaseList: TStringList);
var
  TmpCursor: hDbiCur;
  Database: DBDesc;
  rslt: DbiResult;
begin
  DatabaseList.Clear;
  Check(DbiOpenDatabaseList(TmpCursor));
  repeat
    rslt:= DbiGetNextRecord(TmpCursor, dbiNOLOCK, @Database, nil);
    if (rslt <> DBIERR_EOF) then
    begin
      DatabaseList.Add(StrPas(Database.szName)
        + ' - ' + StrPas(Database.szPhyName)
        +  ' - ' + StrPas(Database.szDbType))
    end;
  until rslt <> DBIERR_NONE;

  Check(DbiCloseCursor(TmpCursor));
end;




0
 
LVL 2

Author Comment

by:greendot
ID: 1358800
Zif,

thanks for pointing me into the right direction...

your answer was straight from the help file.  :)
But from in there, I found out that TSession has a GetAliasNames routine built in.
Which worked like a champ.

-g
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1358801
yes, forgot about the TSession component.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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