Board index » delphi » A little confused about setting up Data Controls on form - IBX

A little confused about setting up Data Controls on form - IBX

Hello all,

I know this must sound stupid, but I cannot seem to grasp the instructions
in the help file for setting up data controls on a form.  Help file says...

****************************************************************************
*
To associate a data control with a dataset,

1 Place a dataset in a data module (or on a form), and set its properties as
appropriate.
(Did this...place an IBDataset ont the form)

2 Place a data source in the same data module (or form). Using the Object
Inspector, set its DataSet property to the dataset you placed in step 1.
(Here is where I'm lost.  I look and there doesn't seem to be a Datasource
component for IB.  I've looked all over the pallete, but....)
****************************************************************************
*
I have an IBDatabase comp. on a separate DataModule with an IBTransaction
comp.  I'm sure the help file is refering to something else, but I can't
seem to make the connection.  (LOL, no pun intended)

A little help would be greatly appreciated.  Again, sorry for the dumb post,
but I've looked at the help file.

Thanks for your patience.

Lee

 

Re:A little confused about setting up Data Controls on form - IBX


Quote
"Lee Jenkins" <lee_jenkin...@datatrakpos.com> wrote in message

news:3c1ebc02$1_1@dnews...

Quote

> 2 Place a data source in the same data module (or form). Using the Object
> Inspector, set its DataSet property to the dataset you placed in step 1.
> (Here is where I'm lost.  I look and there doesn't seem to be a Datasource
> component for IB.  I've looked all over the pallete, but....)

There is only one TDatasource component and it works with all TDataset
descendants (TQuery, TIBDataset, etc). There is not special one for IBX.

--
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:A little confused about setting up Data Controls on form - IBX


Hey thanks for responding Wayne.

OK, but where is it?  Is is a Visual component?

Thanks again,

Lee

Re:A little confused about setting up Data Controls on form - IBX


OK, I found it on the DataAccess tab.  Now why on earth would they put it
there? :-)

Would you mind providing an example of exactly what components are involved
in setting up data controls?

Thanks,

Lee

Re:A little confused about setting up Data Controls on form - IBX


Quote
> OK, I found it on the DataAccess tab.  Now why on earth would they put it
> there? :-)

It's from the time only BDE was there. So the TDataSource is located next to
TTable, TQuery etc. that were used by then. You can of course move it to the
interbase tab, if you wish.

Quote
> Would you mind providing an example of exactly what components are
involved
> in setting up data controls?

Assuming you use IBX...

For the data access (best placed on a data module):
  TIBDatabase to connect to the database (link to TIBTransaction)
  TIBTransaction (link to TIBDatabase)
  TIBDataSet (link to TIBDatabase) to access a table or another result set
(fill in SelectSQL property)
  TDataSource (link to TIBDataSet)

  TIBDatabase must have Connected set to true; TIBDataSet must have Active
set to true.

For the data controls (on a form):
  any controls you want, e.g.
  TDBGrid (link to TDataSource, add data module to uses clause of the form
with Alt+F11)
  TDBEdit (like TDBGrid, but now you must also fill in the DataField
property)

If you want to be able to post changes to the database, you must right-click
on the TIBDataSet, click on DataSet editor and then click on the four
buttons (top button first). It then generates the required SQL to post
changes. (For complex datasets, you may have to adjust this SQL manually.)

Personally, I have never understood why a TDataSource is necessary and you
cannot assign data-aware controls directly to a TDataSet descendant.

HTH,

Peter

Re:A little confused about setting up Data Controls on form - IBX


That helps alot, Pete.

I appreciate your help as well as other's who've posted back.

Thanks to all,

Lee

Re:A little confused about setting up Data Controls on form - IBX


Gosh, as a newbie myself, I just read your reply to Lee's Q Peter and with
the obvious time that you had taken to do so and yourattention to detail I
feel absolutely safe having just moved this this development environment
that I would not be out there on a limb.

Jackie

Quote
"P.G. Willemsen" <pgwillem...@bedenkt.nl> wrote in message

news:3c1f3dd3_1@dnews...
Quote
> > OK, I found it on the DataAccess tab.  Now why on earth would they put
it
> > there? :-)

> It's from the time only BDE was there. So the TDataSource is located next
to
> TTable, TQuery etc. that were used by then. You can of course move it to
the
> interbase tab, if you wish.

> > Would you mind providing an example of exactly what components are
> involved
> > in setting up data controls?

> Assuming you use IBX...

> For the data access (best placed on a data module):
>   TIBDatabase to connect to the database (link to TIBTransaction)
>   TIBTransaction (link to TIBDatabase)
>   TIBDataSet (link to TIBDatabase) to access a table or another result set
> (fill in SelectSQL property)
>   TDataSource (link to TIBDataSet)

>   TIBDatabase must have Connected set to true; TIBDataSet must have Active
> set to true.

> For the data controls (on a form):
>   any controls you want, e.g.
>   TDBGrid (link to TDataSource, add data module to uses clause of the form
> with Alt+F11)
>   TDBEdit (like TDBGrid, but now you must also fill in the DataField
> property)

> If you want to be able to post changes to the database, you must
right-click
> on the TIBDataSet, click on DataSet editor and then click on the four
> buttons (top button first). It then generates the required SQL to post
> changes. (For complex datasets, you may have to adjust this SQL manually.)

> Personally, I have never understood why a TDataSource is necessary and you
> cannot assign data-aware controls directly to a TDataSet descendant.

> HTH,

> Peter

Other Threads