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

2016-02-25 Thread Michael Van Canneyt
On Thu, 25 Feb 2016, Bo Berglund wrote: On Thu, 25 Feb 2016 08:57:40 +0100 (CET), Michael Van Canneyt wrote: It seems like in some examples one uses the transaction as follows: ATransaction.StartTransaction; .. do database stuff ... ATransaction.Commit; In

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

2016-02-25 Thread Bo Berglund
On Thu, 25 Feb 2016 08:57:40 +0100 (CET), Michael Van Canneyt wrote: >> >> It seems like in some examples one uses the transaction as follows: >> ATransaction.StartTransaction; >> .. do database stuff ... >> ATransaction.Commit; >> > >In general it is better to explicitly

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

2016-02-24 Thread Michael Van Canneyt
On Thu, 25 Feb 2016, Bo Berglund wrote: On Wed, 24 Feb 2016 11:47:18 +0100 (CET), Michael Van Canneyt wrote: constructor TUserDb.Create; begin FConn := TMSSQLConnection.Create(NIL); FTrans := TSQLTransaction.Create(NIL); You must additionally set

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

2016-02-24 Thread Bo Berglund
On Wed, 24 Feb 2016 11:47:18 +0100 (CET), Michael Van Canneyt wrote: >> constructor TUserDb.Create; >> begin >> FConn := TMSSQLConnection.Create(NIL); >> FTrans := TSQLTransaction.Create(NIL); > >You must additionally set > > FConn.Transaction:=FTrans; > >> FQuery :=

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

2016-02-24 Thread Michael Van Canneyt
On Wed, 24 Feb 2016, Bo Berglund wrote: On Wed, 24 Feb 2016 11:47:18 +0100 (CET), Michael Van Canneyt wrote: You must additionally set FConn.Transaction:=FTrans; Thank you so much That single omission corrected fixed the problem! This is my first ever

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

2016-02-24 Thread Bo Berglund
On Wed, 24 Feb 2016 11:47:18 +0100 (CET), Michael Van Canneyt wrote: >You must additionally set > > FConn.Transaction:=FTrans; Thank you so much That single omission corrected fixed the problem! This is my first ever database query execution from Lazaus on Linux

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

2016-02-24 Thread Michael Van Canneyt
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

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

2016-02-24 Thread Bo Berglund
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) Now I have a different problem