Hi!
In case of still using BDE, you can try Session managament. Add to uses list: DBTables.
Here is an examle from delphi7 help file:
The following example specifically creates a local alias pointing to the application directory. Note that this alias is automatically deleted when the application terminates and will not be saved to the BDE configuration file.
begin
with Session do
begin
ConfigMode := cmSession;
try
AddStandardAlias('TEMPDB', ExtractFilePath(ParamStr(0)), 'PARADOX');
finally
ConfigMode := cmAll;
end;
end;
Adds a standard Borland Database Engine (BDE) alias to the session for Paradox, dBASE, or ASCII tables.
Delphi syntax:
procedure AddStandardAlias(const Name, Path, DefaultDriver: String);
C++ syntax:
void __fastcall AddStandardAlias(const AnsiString Name, const AnsiString Path, const AnsiString DefaultDriver);
Description
Call AddStandardAlias at runtime to create a session-specific BDE alias for Paradox, dBASE or ASCII tables. Name is the unique name to assign to the alias. Path specifies the directory where the database is located. DefaultDriver is the name of the standard BDE driver to use for the alias. If set, DefaultDriver must be one of Paradox, DBASE, or ASCIIDRV. If left blank DefaultDriver defaults to Paradox. DefaultDriver is used when attempting to open a table that both does not have an extension and is defined as a table of type ttDefault.
A sessions ConfigMode property determines whether an alias is local to the session, or is available to all applications in the BDE persistent store as long as any BDE clients are active. the lifetime of the session. To save an alias permanently, call the SaveConfigFile method before ending the session.
Note: To create an alias for an SQL database, call AddAlias instead of AddStandardAlias.
I hope, this is what you looking for.
Softman
: : : That is true. However, as far as I know (what I read in several books on Delphi programming), refusing to use BDE may decrease the speed of working with data significantly (20 times and more in some cases). I do not know whether that is really the case, but that is what I read.
: : :
: :
: : I cant pass comment on what the books you have read say, as I dont know which books they are. But I wouldn't mind guessing that the author has some association with Borland and therefore chooses to promote their own software.
: :
: : Whilst using delphi 5 and not having the ado components that ship with certain versions of delphi I used the BDE to open both Paradox and Access databases. Neither way compared to 3rd party components I downloaded to connect directly to access databases, in particular, diamond access components. If you have the opportunity to create an access database I would recommend you visit www.islamov.com and download the diamond access components. If you can get the BDE to work 20 times faster than these components I would be grateful to know how!
:
: Thanks for info and the link! I will certainly try it!
: