On 3/14/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
> On Tue, 2006-03-14 at 08:48 -0800, johnf wrote:
> > BTW in the testing I did not set the properties in code but on the property
> > sheet.  Could this be something?
>
> Yes. That's why Michael gave you the code in his first reply.
>
> There is a bug in Lazarus related to the scope of datamodules. In
> design-time it doesn't work, but it does if you do it with code.

Exactly, if you connect first, then as suggested (from my memory too)
plug the sqlquery to the opened database:

> >>> Thanks but it did not work.  I added the following:
> >>> self.SQLQuery1.DataBase:= data3.DataModule1.PQConnection1;
> >>>  self.SQLQuery1.Transaction :=data3.DataModule1.SQLTransaction1;
> >>>  self.SQLQuery1.DataBase.DatabaseName :='Real-Accounting';

this should work without a glitch at run time.

And dont' forget to clese the connection at the end! :) (It's supposed
to be done automatically???, but clean code is clean code: do it
yourself!)

--
Alexandre Leclerc

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to