Solved

Programmatic Merge .cfg files

Posted on 1998-07-27
4
362 Views
Last Modified: 2010-04-03
How do I programmatically merge a .cfg file into the current idapi32.cfg file?
0
Comment
Question by:chrismo
  • 3
4 Comments
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
I'm sorry, but can someone tell me what's a .cfg file, and what is it used for? Some part of a help file???? :)

Viktor Ivanov
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Hi viktornet, I believe it's the configuration file of the BDE in which all the aliases etc are stored. Zif.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 90 total points
Comment Utility
Hi chrismo,

look at the examples Inprise itself proposes :

http://www.inprise.com/devsupport/bde/bdeapiex/dbiopencfginfolist.html

Regards, Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
Look also at BDE32.hlp!

to add a drive : function DbiAddDriver (hCfg: hDBICfg; pszDriverName: PChar; pszParams: PChar; bPersist: Bool): DBIResult stdcall;

to add an alias :

Delphi Examples: DbiAddAlias

Example 1: Add a STANDARD database alias to the configuration file.

This example uses the following input:
      fDbiAddAlias1('TestAlias', 'PATH:C:\BDE32\EXAMPLES\TABLES');

procedure fDbiAddAlias1(AliasName, AliasPath: String);
begin
  Check(DbiAddAlias(Nil, PChar(AliasName), Nil, PChar(AliasPath), True));
end;

Example 2: Add an InterBase database alias to the configuration file.

This example uses the following input:

fDbiAddAlias2('RemoteAlias', 'PATH:frobosrv:d:/interbas;' +
              'SERVER NAME:frobosrv:d:/interbas/slim.gdb;' +
              'USER NAME:test;' +
              'SQLQRYMODE:SERVER;' +
              'SQLPASSTHRU MODE:SHARED NOAUTOCOMMIT');

Note: The last parameter in the string does not have a semicolon ( ; ) at the end.

procedure fDbiAddAlias2(AliasName, AliasPath: String);
begin
  Check(DbiAddAlias(Nil, PChar(AliasName), 'INTRBASE', PChar(AliasPath), True));
end;

Zif.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

6 Experts available now in Live!

Get 1:1 Help Now