How to configure TSQLConnection with SQLite?

0

I chose Sqlite as the driver for the SQLConnection1 component using the Object Inspector.

Whenever I run my VCL Forms Application with these codes:

procedure TForm6.FormCreate(Sender: TObject);
begin
  SQLConnection1.Params.Add('Database=C:\test.s3db');
  SQLConnection1.Connected := true;
end;

I am getting Debugger Exception Notifications.

First chance exception at $74FFB727. Exception class EExternalException with message 'External exception C06D007E'. Process Project5.exe (3508)

and

First chance exception at $00000000. Exception class $C0000005 with message 'access violation at 0x00000000: read of address 0x00000000'. Process Project5.exe (3508)

sqlite
delphi
asked on Stack Overflow Sep 20, 2015 by Wennie • edited Sep 20, 2015 by Wennie

3 Answers

2

According Deploying dbExpress Database Applications

and Tutorial: Connecting to a SQLite Database from a VCL Application

On Windows, in order to connect to an SQLite database, place the library sqlite3.dll in your system path and verify that sqlite3.dll can be found by your application.

On Windows 32-bit: C:\Windows\System32

On Windows 64-bit: C:\Windows\SysWOW64

Оf course the file sqlite3.dll may be in the folder where is the executable file.

answered on Stack Overflow Sep 21, 2015 by Val Marinov • edited Jun 20, 2020 by Community
0

install SQLite ODBC Driver, and use adoconnection to connect. connectionstring like "DRIVER=SQLite3 ODBC Driver;Database=c:\test\test.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;"

answered on Stack Overflow Sep 21, 2015 by superlevin • edited Dec 23, 2017 by Glorfindel
0

In RAD Studio 10.2, using SQLConnection1.LoginPrompt := false solved the issue.

ConStr := 'Database=' + GetCurrentDir + '\nhl.s3db';
SQLConnection1.LoginPrompt := false;
SQLConnection1.Params.Add(ConStr);
SQLConnection1.Connected := true;
answered on Stack Overflow Dec 23, 2017 by Core • edited Dec 23, 2017 by Core

User contributions licensed under CC BY-SA 3.0