Recent

Author Topic: SQLite + Lazarus  (Read 5961 times)

talesrj

  • Newbie
  • Posts: 3
SQLite + Lazarus
« on: April 28, 2015, 07:26:33 am »
Hi guys,
I have the same problem, using Lazarus at Windows 7 x64.
I tried all the places for sqlite3.dll (same dir than project, windows, system32, etc), but without sucess. Everytime that I tried to run a SQLite, this error appears:

Project projeto raised exception class 'EInOutError' with message:
Can not load SQLIT client library "sqlite3.dll". Check you installation.

At address 63B1AF

Does anybody can help me?

Thanks!

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: SQLite + Lazarus
« Reply #1 on: April 28, 2015, 07:37:47 am »
Set environment variable(system, advanced settings, environment var, path).

p.s. http://forum.lazarus.freepascal.org/index.php/topic,26148.msg161010.html#msg161010

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: SQLite + Lazarus
« Reply #2 on: April 28, 2015, 09:05:59 am »
I tried all the places for sqlite3.dll (same dir than project, windows, system32, etc), but without sucess.
Have you tried to put "sqlite3.dll" to "Lazarus.exe" dir?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11458
  • FPC developer.
Re: SQLite + Lazarus
« Reply #3 on: April 28, 2015, 03:15:12 pm »
Yup, sqlite3.dll must be either in a system wide directory or in both the application and ide directories

talesrj

  • Newbie
  • Posts: 3
Re: SQLite + Lazarus
« Reply #4 on: April 28, 2015, 06:36:02 pm »
Hi,
I made three copies of the sqlite3.dll (windows dir, lazarus folder and project folder) and also I set the lazarus path in the system path, but neither of these actions was successful.
Any idea?
Thanks!

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: SQLite + Lazarus
« Reply #5 on: April 28, 2015, 08:14:57 pm »
I have the same problem, using Lazarus at Windows 7 x64.
I tried all the places for sqlite3.dll (same dir than project, windows, system32, etc), but without sucess.
Putting sqlite3.dll in the Lazarus-directory and your project directory (where the .exe is) should be sufficient. But you said: system32. You should know that system32 on a 64-bit system is C:\Windows\SysWOW64 and not C:\Windows\system32.

So 32bit dll's go in C:\Windows\SysWOW64 and 64bit dll's go in C:\Windows\system32. (logic, huh :))
But as said, you don't need the sqlite3.dll in either of those directories.

What you didn't clarify is you target bitness. Are you compiling to a 32bit program or a 64bit program? If you're compiling to a 64bit program you would also need the 64bit sqlite3.dll (and not the 32bit sqlite3.dll).

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: SQLite + Lazarus
« Reply #6 on: April 28, 2015, 08:31:54 pm »
I add my sqlite directory to the system path like this:

From Explorer, right-click "Computer"
Click "Properties"
Click "Advanced System Settings"
Click "Environment Variables"
Under "System Variables", select "Path" and then click the "Edit" button below.

Now, first in the line add:

c:\whatever\sqlite;

Dont forget the SEMICOLON at the end.

And probably you should delete the DLL's you have added to other directories.

« Last Edit: April 28, 2015, 08:58:02 pm by kapibara »
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: SQLite + Lazarus
« Reply #7 on: April 28, 2015, 08:40:13 pm »
SQLite also needs the matching Microsoft Visual C++ Runtime Library to work. I dont remember which one it is though.
Are you sure??? You are talking about "System.Data.SQLite". That's not SQLite itself. System.Data.SQLite is an ADO.NET provider for SQLite.

For SQLite itself refer to: http://www.sqlite.org/
Quote
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.
and
Quote
Self-contained: no external dependencies

So for SQLite itself there is definitely no  Microsoft Visual C++ Runtime Library needed.

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: SQLite + Lazarus
« Reply #8 on: April 28, 2015, 08:55:51 pm »
@RVK Sounds reasonable! I just remember having to install that C++ runtime lib everytime I set up a new machine with Lazarus and DB. But it might be that it is Postgres that needs it, and not SQLite.

Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: SQLite + Lazarus
« Reply #9 on: April 29, 2015, 07:44:03 am »
Hi,
I made three copies of the sqlite3.dll (windows dir, lazarus folder and project folder) and also I set the lazarus path in the system path, but neither of these actions was successful.
Any idea?
Thanks!
check the bitness between lazarus and the dll, they cannot be mixed.

 

TinyPortal © 2005-2018