Board index » delphi » TDatabase not working??

TDatabase not working??

Hi... can you help me??
I have a TDatabase and TQuery and TDataSource on my main form and all
components work fine there.  I then have another form with a TQuery and
TDataSource, where the TQuery is using the database name from the
TDatabase in the master form.  Well, all related fields are blank in my
second form!  I thought the whole point of a TDatabase was the ability
to use one component across many forms?!  What's going on here??

-Dave
deisenb...@titleserv.com

 

Re:TDatabase not working??


Quote
David Eisenberg wrote:

> Hi... can you help me??
> I have a TDatabase and TQuery and TDataSource on my main form and all
> components work fine there.  I then have another form with a TQuery and
> TDataSource, where the TQuery is using the database name from the
> TDatabase in the master form.  Well, all related fields are blank in my
> second form!  I thought the whole point of a TDatabase was the ability
> to use one component across many forms?!  What's going on here??

> -Dave
> deisenb...@titleserv.com

Need more info. I have successfully done what you want; in the master
form procedure that creates the second form, you must also enter
"Form2.Datasource1.Dataset := TTable" [TTable being the table on the
main form].
-Larry

Other Threads