Topic: Connect SQLite with other name

Hi!
I want to connect a SQLite database with a other name then "sqlite.db". Can I do that?
I have ver 2.3.

/Kent

Re: Connect SQLite with other name

Hello,


Please run your project, then follow to menu Options > Settings > tab: Database location


1. Select "Specify the filename of database."
2. Enter the desired name of database file, ex: database.mvd
3. Close project.
4. Rename you database file (sqlite.db) to database.mvd
5. Run project.

Dmitry.

Re: Connect SQLite with other name

Hi.
Thanks, but can i do it in a script?
I want user to chose what database he want to work with.

Re: Connect SQLite with other name

Hello,


You can edit settings.ini file of project and change database location/name, example:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
   ini: TIniFile;
   s: string;
begin
     ini := TiniFile.Create('ExtractFilePath(Application.ExeName) +'settings.ini');
     ini.WriteString('Options', 'server', 'yourdatabasefile.db');
     ini.Free;
end;

After that you should restart the project.

Dmitry.