Bound controls or Classes for database access 
Author Message
 Bound controls or Classes for database access

I have a database using SQL server via ADO.

Can anyone tell me if I should use Bound controls, or create a Class for
each recordset, and manually assign data??

I have been told to avoid Bound controls, as they are not very
scaleable.....
However, the Data Environment module helps to create Bound controls on a
form, so I believe that MS must think that this is a 'good' solution, and
not necessarily a 'quick' solution....

I have also been advised to avoid Bound controls, and manually assign values
to my controls, originating from a class based on the recordset....

Which is considered to be the best programming practice??

Any opinions or help appreciated



Thu, 10 Oct 2002 03:00:00 GMT  
 Bound controls or Classes for database access

Quote:
> I have a database using SQL server via ADO.

> Can anyone tell me if I should use Bound controls, or create a Class for
> each recordset, and manually assign data??

Whether you create a class for each recordset or design it some other way,
use code and avoid bound controls.

Quote:
> I have been told to avoid Bound controls, as they are not very
> scaleable.....

That's part of the problem.  They also take control away from you forcing
you to write code to get around their behavior.  Unless it's a very simple
app you'll end up with lots of code anyway so you may as well just do it
correctly right from the start.  If you design it right you get re-usable,
scalable components.  If you use bound controls you are stuck in at best a
two-tier environment and are limited in how many users you can support.

Quote:
> However, the Data Environment module helps to create Bound controls on a
> form, so I believe that MS must think that this is a 'good' solution, and
> not necessarily a 'quick' solution....

No, I'd gess they do think it is a 'quick' solution and that lets them
market VB as rapid and easy development.  That's true, but only if you are
satisfied with really crappy code.

Quote:
> I have also been advised to avoid Bound controls, and manually assign
values
> to my controls, originating from a class based on the recordset....

> Which is considered to be the best programming practice??

> Any opinions or help appreciated

No data binding.


Thu, 10 Oct 2002 03:00:00 GMT  
 Bound controls or Classes for database access
While I might agree with your other points, using "Bound" controls, does NOT in general limit you to a 2 tier implementation.

Controls such as MSFlexGrid and DataGrid can be bound to disconnected ADO recordsets in the client.  Then, there is no underlying
database connection going back to the client through the middle tier.  Whether you use Bound Controls or not is purely a client
design and construction issue.  You can create the disconnected recordset either in the data or middle tier, either directly from
database tables or completely in code.

--
Happiness is understanding how things work!

It is futile to know the correct answer to the wrong question!


Quote:



> > I have a database using SQL server via ADO.

> > Can anyone tell me if I should use Bound controls, or create a Class for
> > each recordset, and manually assign data??

> Whether you create a class for each recordset or design it some other way,
> use code and avoid bound controls.

> > I have been told to avoid Bound controls, as they are not very
> > scaleable.....

> That's part of the problem.  They also take control away from you forcing
> you to write code to get around their behavior.  Unless it's a very simple
> app you'll end up with lots of code anyway so you may as well just do it
> correctly right from the start.  If you design it right you get re-usable,
> scalable components.  If you use bound controls you are stuck in at best a
> two-tier environment and are limited in how many users you can support.

> > However, the Data Environment module helps to create Bound controls on a
> > form, so I believe that MS must think that this is a 'good' solution, and
> > not necessarily a 'quick' solution....

> No, I'd gess they do think it is a 'quick' solution and that lets them
> market VB as rapid and easy development.  That's true, but only if you are
> satisfied with really crappy code.

> > I have also been advised to avoid Bound controls, and manually assign
> values
> > to my controls, originating from a class based on the recordset....

> > Which is considered to be the best programming practice??

> > Any opinions or help appreciated

> No data binding.



Fri, 03 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Bound controls or Classes for database access

2. Bound controls or Classes for database access

3. VB4 Data bound control program for a Secured Access Database

4. Bound control with secured access database

5. Access 97 bound or not ot bound controls

6. Dataset binding, can a class property be bound ?

7. Binding Controls to classes

8. Binding Controls to Classes

9. VB4 Classes and Bound Controls

10. Binding controls to class properties

11. Creating a control class that can be a data binding data source

12. Binding controls to class properties

 

 
Powered by phpBB® Forum Software