procedure TApplicatieMetaData.ConnectTo(DbFile: string; CreateNew: boolean;Connection:TSQLConnection);
begin
with Connection do
begin
Connected := False;
DriverName := 'SQLite';
LibraryName := 'DbxSQLite.dll';
GetDriverFunc := 'getSQLDriverSQLite';
VendorLib := 'sqlite.dll';
Params.Text := 'Database='+DbFile;
// Params.Add('AutoCommit=False');
Params.Add(
'RoleName=Cache=2000|'+
'TextLength=1024|'+
'CanCreateDb='+BoolToStr(CreateNew, True)+'|'+
'BdeBlobText=True|'+
'VirtualMachine=True');
LoadParamsOnConnect := False;
KeepConnection := True;
Connected := True;
end;
end;
Kind regards Bert Verhees
Bert Verhees wrote:
Hi, I am using the dbExpress-driver from Marco Wobben, maybe he can answer but I do not want to overload him that's why I rather ask on a public forum first, and he has the opportunity to answer if it is convenient.
Works fine, but I have one question. Maybe someone knows the answer.
I fill in the params on execute-time of the application.
That is because I do not want to provide ini-files, etc. And I want to change the database-file-name on runtime.
I am writing in Delphi, probably want to write this for Kylix too (that's why dbExpress), but first have it running in Delphi, and I experience following problem
I fill in the params with following code (FDM is the datamodule):
FDM.MetaDB.Params.Clear; FDM.MetaDB.Params.Values['DriverName']:='SQLite'; FDM.MetaDB.Params.Values['RoleName']:='Cache'; FDM.MetaDB.Params.Values['Cache']:='2000'; FDM.MetaDB.Params.Values['TextLength']:='1024'; FDM.MetaDB.Params.Values['Database']:='meta.db'; FDM.MetaDB.Connected := True;
If the file meta.db does not exist I want it to be created on the current directory, but this does not happen, it keeps complaining about a not existing database, even generates an exception.
So, someone who can tell me how to generate a new database-file using a dbExpress environment?
Strange thing is, it did a few times generate a database-file but suddenly stopped doing that, I don't know why
thanks in advance Kind regards Bert Verhees
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

