Binding controls to a recordset. 
Author Message
 Binding controls to a recordset.

I have a form with several controls bound to a ado data control.  I want to
remove the data control and bind the controls to a recordset.  I have used
ado recordsets previously, but have not bound controls to one.  Can I bind
the controls to the recordset (which is obviously created at runtime) during
design time, or do I have to set each controls DataSource and DataField
property at runtime?

Thanks,
Tom



Sun, 30 Nov 2003 20:23:07 GMT  
 Binding controls to a recordset.
Yes, you do set the DataSource and DataField properties at runtime:

Set MyControl.DataSource = rs
MyControl.DataField = "ColumnName"

/Tommy


Quote:
> I have a form with several controls bound to a ado data control.  I want
to
> remove the data control and bind the controls to a recordset.  I have used
> ado recordsets previously, but have not bound controls to one.  Can I bind
> the controls to the recordset (which is obviously created at runtime)
during
> design time, or do I have to set each controls DataSource and DataField
> property at runtime?

> Thanks,
> Tom



Mon, 01 Dec 2003 00:11:59 GMT  
 Binding controls to a recordset.
Tom,
You could set all the DataField properties at design time and then at
runtime loop through your controls and set the DataSource property. Which
ever way you like best.


Quote:
> Yes, you do set the DataSource and DataField properties at runtime:

> Set MyControl.DataSource = rs
> MyControl.DataField = "ColumnName"

> /Tommy



> > I have a form with several controls bound to a ado data control.  I want
> to
> > remove the data control and bind the controls to a recordset.  I have
used
> > ado recordsets previously, but have not bound controls to one.  Can I
bind
> > the controls to the recordset (which is obviously created at runtime)
> during
> > design time, or do I have to set each controls DataSource and DataField
> > property at runtime?

> > Thanks,
> > Tom



Mon, 01 Dec 2003 05:33:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Binding bound controls to a recordset object?? VB4 Pro

2. Data designer bound controls seem to lose their binding to the recordset with Requery

3. Data designer bound controls seem to lose their binding to the recordset with Requery

4. Recordset reuse/Rebind Controls Versus Many Recordsets/Binding once

5. Finding a record in a Bound recordset (bound using the DataEnvironment)

6. Finding a record in a Bound recordset (bound using the DataEnvironment)

7. empty recordset cannot be bound to control

8. Bind an ado recordset directly to an ado data control (adodc)

9. displaying a returned recordset in a bound control (DataList)

10. Changing the source on an ADO recordset bound to controls

11. Binding a control to a recordset defined by code

12. Question about editing recordset using MSFlexGrid bound to a Data control

 

 
Powered by phpBB® Forum Software