Recent

Author Topic: Opening a SQLite database in Lazarus.  (Read 10640 times)

BertH

  • New Member
  • *
  • Posts: 28
Opening a SQLite database in Lazarus.
« on: July 31, 2010, 06:04:46 pm »
While "rebuilding" a simple program using a DBase file into one using a SqLite file I could not find how to open the file. If I enter the file path in the filepath of the properties of the Object Inspector the data are shown in the grid. But using the

procedure TForm1.AOpenExecute(Sender: TObject);
begin
   With ODDBA do
   if Execute then
      Openfile(Filename);
end;             
 
as used in the dBase program, I get error>> unit1.pas(88,15) Error: Identifier not found "Openfile"

I looked through this Forum and the SQL documentation but could not find the correct termonology for SQLite.
Would appreciate your help.


Bert

BertH

  • New Member
  • *
  • Posts: 28
Re: Opening a SQLite database in Lazarus.
« Reply #1 on: July 31, 2010, 06:11:35 pm »
Sorry, correction on previous question.
In dBase the term is OpenTable(...). That also gave the error in SQLite. OpenFile was one of my estimated guesses but did not work either.

JD

  • Hero Member
  • *****
  • Posts: 1847
Re: Opening a SQLite database in Lazarus.
« Reply #2 on: July 31, 2010, 06:38:28 pm »
Windows (10) - Lazarus 2.1/FPC 3.2 (svn 64160 built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (svn 64380 built using fpcupdeluxe),
Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

BertH

  • New Member
  • *
  • Posts: 28
Re: Opening a SQLite database in Lazarus.
« Reply #3 on: July 31, 2010, 10:51:42 pm »
Thanks for the suggestion. However I just started to understand a little of Lazarus with a very limited experience of Delphi and Access. I am experimenting with Lazarus and SqLite to see if that could replace the things I did with Access. I started with dBase because I had some experience with Visual dBase a long time ago.
I looked into the Zeos link you gave but I don't see myself following those instructions and end up with a working system let alone that I have to learn another new dialect called Zeos. I assume there must be a simple way to open a SQlite database from with an application. My problem is to find that way. The available docs and forum discussions did not help sofar.

Bert

JD

  • Hero Member
  • *****
  • Posts: 1847
Re: Opening a SQLite database in Lazarus.
« Reply #4 on: August 01, 2010, 01:53:56 am »
I looked into the Zeos link you gave but I don't see myself following those instructions and end up with a working system let alone that I have to learn another new dialect called Zeos. I assume there must be a simple way to open a SQlite database from with an application. My problem is to find that way. The available docs and forum discussions did not help sofar.

An alternative is SQLite Database Objects for Lazarus http://source.online.free.fr/

The demos & examples should tell you what you need to know.
Windows (10) - Lazarus 2.1/FPC 3.2 (svn 64160 built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (svn 64380 built using fpcupdeluxe),
Delphi

Indy 10.6 series; mORMot; Zeos 7.3; SQLite, Firebird, PostgreSQL & MariaDB; VirtualTreeView 5.5.3 R1

 

TinyPortal © 2005-2018