[Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Mon Jan 24 09:47:26 CET 2011



On Mon, 24 Jan 2011, Bo Berglund wrote:

> On Mon, 24 Jan 2011 10:26:14 +0200, Graeme Geldenhuys
> <graemeg.lists at gmail.com> wrote:
>
>> Op 2011-01-24 09:57, Andreas Schneider het geskryf:
>>> That  probably  won't work and will only cause trouble. He is probably
>>> using  the  LCL counterpart to sqldb (lazsqldb or however it's called)
>>
>> Ah, good point. I always use the database components directly from FCL,
>> so this does work in my cause though.
>>
>
> Pray:
> exactly how do you do this? What ia FCL?

FCL = Free Component Library, a set of units, distributed with FPC.

> What would be the procedure be for someone who has installed FPC from
> the binary distribution and downloaded the corresponding FPC sources
> to a directory, which has been configured in lazarus?
>
> I have not yet learned these tools (lazarus, fpc) fully because I am
> still avaluating them, so I have installed the FPC 2.4.2 release
> binary package and used svn to get the fixed lazarus. Therefore I have
> learned how to rebuild lazarus, but not FPC.
> Must one really rebuild the *compiler* to make a simple source change
> in a peripheral component work in a single lazarus project?
>
> My evaluation involves the following:
> - Possibility to transfer code from Delphi 7
> - GUI application compatibility (simple graphics and listview
> handling)
> - Handling of serial ports
> - Database functionality
> - Cross-compilation for the embedded ARM platform
> - etc
>
> I am currently stuck in the database evaluation because the SQLdb
> component does not allow returning records from an EXEC call into an
> MSSQL Server database engine. This is what this is all about fixing.

The instructions given to you by Graeme should be sufficient:

1. Apply the patch I sent. From the mails, I see you found out how to do this.
    (tip: when working with open source, knowledge of the 'patch' tool is almost essential)

2. Recompile the sqldb package in FPC. In a DOS window:
    (I assume the FPC sources are in c:\fpc\src, modify as needed)

   cd c:\fpc\src\packages\fcl-db\src\sqldb
   make clean
   make all
   make install

   If there are no errors, this should have updated your FPC installation.

3. Optionally, recompile the lazsqldb (or is it sqldblaz ?) package of lazarus.
   It is not necessary to recompile the LCL or Lazarus itself.

4. Recompile your application.

That should do it.

Michael.




More information about the Lazarus mailing list