Solved

Getting a list of BDE Aliases?

Posted on 1998-07-28
3
335 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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
yes, forgot about the TSession component.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

772 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

16 Experts available now in Live!

Get 1:1 Help Now