[Lazarus] SQLDb and TSQLQuery usage for MSSQL database...

Michael Van Canneyt michael at freepascal.org
Wed Feb 24 11:47:18 CET 2016



On Wed, 24 Feb 2016, Bo Berglund wrote:

> In my previous thread I received help that made it possible for me to
> connect from my RPi2 to an MSSQL database server on a Windows server
> in the network using the TMSSQLConnection component.
> So the connectivity seems fine.
> (Using FPC 3.0.0 and Lazarus 1.6)
>
> end;
>
> constructor TUserDb.Create;
> begin
>  FConn := TMSSQLConnection.Create(NIL);
>  FTrans := TSQLTransaction.Create(NIL);

You must additionally set

   FConn.Transaction:=FTrans;

>  FQuery := TSQLQuery.Create(NIL);
>  FQuery.DataBase := FConn; // <== Database property set here!!!
>  FQuery.Transaction := FTrans;
> end;

Michael.




More information about the Lazarus mailing list