Board index » delphi » IBX - Data Control problem

IBX - Data Control problem

I'm using a tIBQuery, tIBTransaction, tIBDatabase, and tDataSource to
provide data to dbEdit controls on a form from an IB6 db. In Design mode,
everything active, the data shows in the controls. When I run the app,
however, the data controls are blank. I know I'm doing something stupid, but
what?

D5 Pro, latest IBX components, Win2K

 

Re:IBX - Data Control problem


Quote
"Gary Mrenak" <gmre...@earthlink.com> wrote in message

news:3c0ee3ad_2@dnews...

Quote
> I'm using a tIBQuery, tIBTransaction, tIBDatabase, and tDataSource to
> provide data to dbEdit controls on a form from an IB6 db. In Design mode,
> everything active, the data shows in the controls. When I run the app,
> however, the data controls are blank. I know I'm doing something stupid,
but
> what?

You need to set the TIBQuery active at runtime.

--
Wayne Niddery (Logic Fundamentals, Inc.)
RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
Try to make original mistakes, rather than needlessly repeating [others]. -
Donald Rumsfeld, U.S. Secretary of Defense

Re:IBX - Data Control problem


I have the following in a Data Module OnCreate event handler:

 TDSI.Connected := true; {the tIBDatabase component}
  qTDSI.Active := true; {the tIBQuery}

But still the same result, even if I use tIBTable instead of tIBQuery.

"Wayne Niddery [TeamB]" <wnidd...@aci.on.ca> wrote in message
news:3c0ee80c_1@dnews...

Quote
> "Gary Mrenak" <gmre...@earthlink.com> wrote in message
> news:3c0ee3ad_2@dnews...
> > I'm using a tIBQuery, tIBTransaction, tIBDatabase, and tDataSource to
> > provide data to dbEdit controls on a form from an IB6 db. In Design
mode,
> > everything active, the data shows in the controls. When I run the app,
> > however, the data controls are blank. I know I'm doing something stupid,
> but
> > what?

> You need to set the TIBQuery active at runtime.

> --
> Wayne Niddery (Logic Fundamentals, Inc.)
> RADBooks: http://www.logicfundamentals.com/RADBooks/delphibooks.html
> Try to make original mistakes, rather than needlessly repeating
[others]. -
> Donald Rumsfeld, U.S. Secretary of Defense

Re:IBX - Data Control problem


Quote
"Gary Mrenak" <gmre...@earthlink.com> wrote in message

news:3c0f5ce4$1_2@dnews...

Quote
> I have the following in a Data Module OnCreate event handler:

>  TDSI.Connected := true; {the tIBDatabase component}
>   qTDSI.Active := true; {the tIBQuery}

> But still the same result, even if I use tIBTable instead of tIBQuery.

It sounds to me like either you aren't looking at the right datasource with
the edit controls or the connection between the query and datasource is
somehow being disconnected when running the program. Step into the code when
you activate the query and test for these two things to make sure it's all
connected properly.

Woody

Re:IBX - Data Control problem


Thanks to you and Wayne for the replies.

How about the following:

In a new project, added and configured (directly on the new form)
tIBDatabase, tIBTransaction, tIBTable, and tDatasource, then added a dbEdit
#1 to the form to show one of the fields. AND IT WORKED when I ran it, that
is, the data appeared in the dbEdit at runtime just as it did at design
time.

THEN, added a Datamodule to the new project containing another set of the
same components, "used" the datamodule in the form unit, added another
dbEdit #2 to the form to show one of the fields. IT DID NOT WORK! Even
though the data appeared in the field at design time, it disappeared at
runtime. dbEdit #1, supplied with data from the "on-form" components,
continued to work fine.

As far as I can see, the only difference is the datamodule. Or am I missing
something basic?

Quote
"Woody" <woody....@ih2000.net> wrote in message news:3c0f9212$1_1@dnews...
> "Gary Mrenak" <gmre...@earthlink.com> wrote in message
> news:3c0f5ce4$1_2@dnews...
> > I have the following in a Data Module OnCreate event handler:

> >  TDSI.Connected := true; {the tIBDatabase component}
> >   qTDSI.Active := true; {the tIBQuery}

> > But still the same result, even if I use tIBTable instead of tIBQuery.

> It sounds to me like either you aren't looking at the right datasource
with
> the edit controls or the connection between the query and datasource is
> somehow being disconnected when running the program. Step into the code
when
> you activate the query and test for these two things to make sure it's all
> connected properly.

> Woody

Re:IBX - Data Control problem


Is the data module being Created before the form?  If it is not then the VCL
Streaming mechanism will turn all the Datasource links to nil when creating the
form.

Quote
Gary Mrenak wrote:

> Thanks to you and Wayne for the replies.

> How about the following:

> In a new project, added and configured (directly on the new form)
> tIBDatabase, tIBTransaction, tIBTable, and tDatasource, then added a dbEdit
> #1 to the form to show one of the fields. AND IT WORKED when I ran it, that
> is, the data appeared in the dbEdit at runtime just as it did at design
> time.

> THEN, added a Datamodule to the new project containing another set of the
> same components, "used" the datamodule in the form unit, added another
> dbEdit #2 to the form to show one of the fields. IT DID NOT WORK! Even
> though the data appeared in the field at design time, it disappeared at
> runtime. dbEdit #1, supplied with data from the "on-form" components,
> continued to work fine.

> As far as I can see, the only difference is the datamodule. Or am I missing
> something basic?

--
Jeff Overcash (TeamB)
      (Please do not email me directly unless  asked. Thank You)
The fool escaped from paradise will look over his shoulder and cry
Sit and chew on daffodils and struggle to answer why?
As you grow up and leave the playground
Where you kissed your Prince and found your frog
Remember the jester that showed you tears, the script for tears. (Fish)

Re:IBX - Data Control problem


That was indeed the problem. In fact, it wasn't being created at all. Many
thanks for the basic Delphi lesson.

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3C0FD089.7B03E612@onramp.net...

Quote
> Is the data module being Created before the form?  If it is not then the
VCL
> Streaming mechanism will turn all the Datasource links to nil when
creating the
> form.

> Gary Mrenak wrote:

> > Thanks to you and Wayne for the replies.

> > How about the following:

> > In a new project, added and configured (directly on the new form)
> > tIBDatabase, tIBTransaction, tIBTable, and tDatasource, then added a
dbEdit
> > #1 to the form to show one of the fields. AND IT WORKED when I ran it,
that
> > is, the data appeared in the dbEdit at runtime just as it did at design
> > time.

> > THEN, added a Datamodule to the new project containing another set of
the
> > same components, "used" the datamodule in the form unit, added another
> > dbEdit #2 to the form to show one of the fields. IT DID NOT WORK! Even
> > though the data appeared in the field at design time, it disappeared at
> > runtime. dbEdit #1, supplied with data from the "on-form" components,
> > continued to work fine.

> > As far as I can see, the only difference is the datamodule. Or am I
missing
> > something basic?

> --
> Jeff Overcash (TeamB)
>       (Please do not email me directly unless  asked. Thank You)
> The fool escaped from paradise will look over his shoulder and cry
> Sit and chew on daffodils and struggle to answer why?
> As you grow up and leave the playground
> Where you kissed your Prince and found your frog
> Remember the jester that showed you tears, the script for tears. (Fish)

Other Threads