On Tuesday 14 March 2006 08:37, Michael Van Canneyt wrote:
> On Tue, 14 Mar 2006, johnf wrote:
> > On Tuesday 14 March 2006 08:01, Michael Van Canneyt wrote:
> >> On Tue, 14 Mar 2006, johnf wrote:
> >>> On Tuesday 14 March 2006 07:48, Michael Van Canneyt wrote:
> >>>> On Tue, 14 Mar 2006, johnf wrote:
> >>>>>> You must set the database property of your SQLQuery1:
> >>>>>>
> >>>>>>   self.SQLTransaction1.DataBase:= data3.DataModule1.PQConnection1;
> >>>>>>   SQLQuery1.Database:=data3.DataModule1.PQConnection1;
> >>>>>>
> >>>>>> Michael.
> >>>>>
> >>>>> 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';
> >>>>>
> >>>>> I still get 'Database not assigned'.  I'm beginning to wonder if
> >>>>> after making the connection I loose the connection because it goes
> >>>>> out of scope. Since I'm a newbie - I really don't know what I'm
> >>>>> doing.  Is there a better way to present this question?
> >>>>
> >>>> For testing:
> >>>> Can you drop the database component on the form, not on the datamodule
> >>>> ? See how far that gets you ?
> >>>>
> >>>> Also: normally I would expect you to set the databasename before you
> >>>> connect it to the query.
> >>>>
> >>>>
> >>>> Michael.
> >>>
> >>> I'm so sorry Michael I don't understand what you mean by "database
> >>> component" - did you mean the TPQConnection ?  I set the database name
> >>> in the TPQConnection (in login form).
> >>
> >> Yes.
> >>
> >> - Drop this TPQConnection component on the same form as the query.
> >> - Set Databasename.
> >> - Connect SQLQuery component.
> >> - Connect transaction component.
> >> - Set SQL
> >> - Open.
> >>
> >> Michael.
> >
> > The above works so what am I missing?  I have attempted to find the
> > difference without success.
>
> 2 things spring to mind:
> - The order of things seems to be important ?
> - when the TPQconnection is on the datamodule, is it correctly initialized
> before you connect your SQLQuery to it ?
>
> Michael.
I would think so because I manually set all the parameters in the login form.  
Also the connected  returns true.  I created a bunch of Var's (string) and 
looked at each setting and they appear to be right.  At least the stuff from 
the pqconnection.  But you said the order is important - could that mean that 
I need the order correct in the other controls.  Should the TSQLtransaction 
properties be set before the TSQLQuery - or the other way around?

John

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

Reply via email to