Recent

Author Topic: Fresh Install + sqlite  (Read 7466 times)

moodsoft

  • Newbie
  • Posts: 5
Fresh Install + sqlite
« on: May 05, 2013, 06:11:54 am »
Hi all,

I've been trying to build an SQLite app with Lazarus and I seem to be having issues. So I'm hoping someone will be able to give me step by step instructions from a fresh install of Lazarus of how to add SQLite so I can get to coding as soon as possible. I tried to follow the directions here: http://sqlite4fpc.yolasite.com/update-fpc-component.php and wounded up getting the error: "The procedure entry point sqlite_changes could not be located in the dynamic link library sqlite.dll" this was with using the latest sqlite.dll from http://sqlite.org/download.html

Help is greatly appreciated!

Chris

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Fresh Install + sqlite
« Reply #1 on: May 05, 2013, 08:28:44 am »
Looks like you are trying to use TSqliteDataset with a sqlite3 dll. The dll you downloaded has to be used with TSqlite3Dataset  in unit sqlite3ds. The functions exported by sqlite.ddl start with sqlite3_ instead of sqlite_. 

moodsoft

  • Newbie
  • Posts: 5
Re: Fresh Install + sqlite
« Reply #2 on: May 06, 2013, 03:57:16 am »
OK I was able to confirm that I do have access to the unit sqlite3ds however I do not seem to see an icon called TSqlite3Dataset, can you tell me what I need to do to enable that?

Chris

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Fresh Install + sqlite
« Reply #3 on: May 06, 2013, 08:26:52 am »
You need to install the package sqlite3laz.lpk. If you installed sqlitelaz.lpk you can better uninstall that package to avoid mistakes later.

moodsoft

  • Newbie
  • Posts: 5
Re: Fresh Install + sqlite
« Reply #4 on: May 07, 2013, 03:15:03 am »
I did this and now told that I need sqlite.dll not sqlite3.dll, however I can't seem to find sqlite.dll for Windows anywhere.

Really wish it came fully installed in Lazarus :).

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: Fresh Install + sqlite
« Reply #5 on: May 07, 2013, 08:00:25 am »
You still use the wrong units. Sqlite3DS uses sqlite3 which does an include of sqlite3.inc. There you'll find
Code: [Select]
{$IFDEF WINDOWS}
  Sqlite3Lib = 'sqlite3.dll';
{$else}

Check that all references to sqliteDS or sqlite are gone from all the uses sections in your program. Better, start a new program, drop a TSQLite3Dataset on a form, configure it and test that.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8798
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Fresh Install + sqlite
« Reply #6 on: May 07, 2013, 08:50:03 am »
Quote
Really wish it came fully installed in Lazarus .
Possible since the license is very permissive (public domain), but I don't think any of the maintainer here want to add that burden to the package. It would be maintenance hell.

moodsoft

  • Newbie
  • Posts: 5
Re: Fresh Install + sqlite
« Reply #7 on: May 16, 2013, 05:41:47 am »
In case there is an easier way, are there any databases that do not require a server back end that Lazarus / Free Pascal supports out of the box?

Pascaluvr

  • Full Member
  • ***
  • Posts: 216
Re: Fresh Install + sqlite
« Reply #8 on: May 16, 2013, 06:13:26 am »
I use SQLite3 for my own projects....   without a problem

If you use win7 ....   put the sqlite3.dll in c:windows\SYSWOW64 (works for both 32 bit and 64 bit)
Windows 7, Lazarus 1.0.8, FPC 2.6.2, SQLite 3

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Fresh Install + sqlite
« Reply #9 on: May 16, 2013, 07:31:19 am »
In case there is an easier way, are there any databases that do not require a server back end that Lazarus / Free Pascal supports out of the box?
tdbf, zcsv. See the wiki for those two.

I wouldn't recommend them so quickly though. Yes, installing dlls is troublesome, but IMO a good tradeoff for the loads of features e.g. Firebird or sqlite can bring you.
That said: to each his own ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

moodsoft

  • Newbie
  • Posts: 5
Re: Fresh Install + sqlite
« Reply #10 on: May 24, 2013, 05:15:37 am »
I see that I have many copies of SQLite3.dll on my computer, while I know it is a waste of disk space is there anywhere in the Lazarus tree I can store the dll that Lazarus will see it?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8798
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Fresh Install + sqlite
« Reply #11 on: May 24, 2013, 08:40:37 am »
Quote
I see that I have many copies of SQLite3.dll on my computer, while I know it is a waste of disk space is there anywhere in the Lazarus tree I can store the dll that Lazarus will see it?
The top directory, where (start)lazarus executable exists.

 

TinyPortal © 2005-2018