Recent

Author Topic: Updated March_6 Source Code Project for database dev., using Lazarus with SQLdb  (Read 48021 times)

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
If your on Linux, or maybe(windows), just a hint, closed your used table ONLY application is shutdown, reused it if possible.
 :D
thank you
« Last Edit: June 12, 2012, 10:07:11 pm by xenblaise »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
You could use Microsoft Access, but you could also use Firebird embedded. This will let you migrate to Firebird client/server by changing a couple of lines of code.

Please see sample code attached. Xenblaise, could you modify your first post to include this sample? Thanks.

Due to space constraints, I couldn't upload the required dlls/exes.

For now, and hopefully in future, you can download everything (source code, dlls) from
http://dl.dropbox.com/u/20995033/FirebirdSampleFull.zip

Thanks.

<Edited: 2 August 2011: added programmatic database creation using sqldb, so no need for isql.exe anymore.>
Contents of readme:
This is a Firebird embedded database sample.
You will need to download the Firebird embedded engine (dlls) - see below.
It is adapted from the Microsoft Access by Xenblaise and SQLite sample by RocaRobin.
It demonstrates how to create an embedded database if it doesn't exist, how to connect, bind grids to the data and edit/update/delete data.

For now, this sample works only on Windows. Advice on how to run it on Linux is welcome.

1. Getting the required files
=================
Due to space constraints, the Firebird dll files are not included in this sample.

1.1 Getting the Firebird embedded dlls
========================
Download Firebird Embedded 2.5 from
http://www.firebirdsql.org/en/firebird-2-5/
(You can use a newer version if available)
Extract these files to your application directory:
fbembed.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll

Because we will need these dlls both while in design mode (in the IDE) and while running your application, make sure that you compile your application into the source directory, so no fancy playing around with crosscompiling to various subdirectories...

« Last Edit: August 03, 2011, 01:48:37 pm by BigChimp »
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

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Quote
could you modify your first post to include this sample?
not now,  :D
and Great, you have created a sample code for using firebird,  that would be helpful for some newbies happening to explore lazarus :D
thanks

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
We're glad you made it :D ;D
thanks

almsoares

  • New member
  • *
  • Posts: 8
Hi

I am newbie in Lazarus, although I had a good experince in database development with Delphi/VB/C#. So I am doing a study about options that I realy have in Lazarus. So I am comparing SQLdb and ZeosLib. With ZeosLib I am had some troubles, but works. With SQLdb I simply can't get a connect with MSSQL.  Can you help me? How I need to configure the property named ConnectorType to get a connection wiht MSSQLServer (2000/20005/2008).

best regards

Adriano Soares

goldenfox

  • New Member
  • *
  • Posts: 47
Very nice example. Thanks.  :)

You could use Microsoft Access, but you could also use Firebird embedded. This will let you migrate to Firebird client/server by changing a couple of lines of code.

Please see sample code attached. Xenblaise, could you modify your first post to include this sample? Thanks.

Due to space constraints, I couldn't upload the required dlls/exes.

For now, and hopefully in future, you can download everything (source code, dlls) from
http://dl.dropbox.com/u/20995033/FirebirdSampleFull.zip

Thanks.

<Edited: 2 August 2011: added programmatic database creation using sqldb, so no need for isql.exe anymore.>
Contents of readme:
This is a Firebird embedded database sample.
You will need to download the Firebird embedded engine (dlls) - see below.
It is adapted from the Microsoft Access by Xenblaise and SQLite sample by RocaRobin.
It demonstrates how to create an embedded database if it doesn't exist, how to connect, bind grids to the data and edit/update/delete data.

For now, this sample works only on Windows. Advice on how to run it on Linux is welcome.

1. Getting the required files
=================
Due to space constraints, the Firebird dll files are not included in this sample.

1.1 Getting the Firebird embedded dlls
========================
Download Firebird Embedded 2.5 from
http://www.firebirdsql.org/en/firebird-2-5/
(You can use a newer version if available)
Extract these files to your application directory:
fbembed.dll
firebird.msg
ib_util.dll
icudt30.dll
icuin30.dll
icuuc30.dll
Microsoft.VC80.CRT.manifest
msvcp80.dll
msvcr80.dll

Because we will need these dlls both while in design mode (in the IDE) and while running your application, make sure that you compile your application into the source directory, so no fancy playing around with crosscompiling to various subdirectories...

 

TinyPortal © 2005-2018