Re: When to (not) use the ADO data control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: MikeD (nobody_at_nowhere.edu)
Date: 08/20/04


Date: Thu, 19 Aug 2004 23:04:53 -0400


"JJ" <jason@thehappyegg.com> wrote in message
news:hAVUc.746$Oa6.127@fe39.usenetserver.com...
> I've been using VB6 for a few years now, and recently started database
> programming (so I'm kinda a noob).

It's "newbie". <g>

> The one thing I keep reading over and
> over is that you should use unbound controls in favor of bound controls.

That's pretty good advice.

> Is
> using the data control really that bad?

Yes, at least for any professional level of development.

> Are there certain situations where
> it's appropriate?

Sure. There are a few. For example, a demo program, or for a program where
"professionalism" is not *quite* as important. If you're just making a
simple database program for your own use (or use by friends or family), it
doesn't have to be professional. If the DataControl gives you the
functionality you need in such a program, use it. I'd NEVER recommend using
it for anything on a professional level. It's not even so much its
appearance or UI. It's the limitations it has. In most cases, you're MUCH
better off using DAO or ADO and writing SQL or calling stored procedures,
etc. to get, update, and insert data into a database. Of course, that
involves learning more (you need to know or learn SQL, how to write stored
procedures, and, in general, how to take advantage of other features the
backend database provides).

>
> This happens to relate to a program I inherited a while back. The
> programmer that wrote the application used a mixture of DAO data controls
> and coded database connections, and actually uses a few ADO data controls
on
> one of the newer forms. (I've always felt that mixing similar
technologies
> in the same program is a serious no-no) The main form alone has NINE data
> controls on it, all attached to different tables in the same database.
Most
> of the data controls were just used to populate combo boxes. It seems to
me
> that the existing program is an absolute mess and that it would make the
> most sense to recode it from scratch using unbound controls and ADO. The
> only thing that even makes me consider using a data control is the fact
that
> some of the forms in this project have 30 to 40 textboxes and comboboxes
in
> them, which may turn into a lot of code. I would love to know how any of
> you infinitely more experienced database programmers would handle recoding
a
> project such as this.

There's really no definitive answer. Every situation is different. Only you
can determine whether it's really worth it (especially to do it all at
once). I am by no means an advocate of bound controls. I detest them. And
I'm really suffering now because I recently started a new job where almost
everything was done in Access (Access 97, no less, for most front-ends, but
some front-ends were Access 2000 and some back-ends [for both Access 97 and
Access 2000 front-ends] are SQL Server [and even with that, some are SQL
Server 6.5, some SQL Server 7, and some SQL Server 2000...what a mess..the
IT Director had no clue whatsoever, thank God he's gone]), so it means bound
controls up the wazoo. But....if taking over an existing project that uses
bound controls heavily AND which runs and works well...why stir up trouble?
Now, as changes need made to the program, and eliminating the bound controls
would be a logical thing to do while making those changes, you bet I'd get
rid of them. But perhaps you could also make the case that the app really
requires a complete re-write from scratch. You need to make such a
determination. Nobody else can without seeing and using the app.

Mike



Relevant Pages

  • Re: The Zen nature of a Delphi database application
    ... results directly to UI controls, then write data from the controls to ... then write data back from the modified objects to the DB for storage? ... I load the whole contents of the database into my business objects, ... I have dreamt of the perfect OO database application framework ...
    (comp.lang.pascal.delphi.misc)
  • Re: multiple subform images per main search form record
    ... Document ScreenDumps of: ... get a marker and label all controls with the Name property so when you ... save your word doc in the directory with the database you are documenting ... Show Images from Continuous Subform ...
    (microsoft.public.access.formscoding)
  • Re: Setting a referenced object to null
    ... "The controls" is an extremely non-specific description. ... of data that is fetched from a database. ... the variable reference something else. ... need to filter what is seen and what is not seen. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ADD method syntax for collections
    ... any database record was capable of displaying three photographs; ... I get "Photo4" highlighted in a line "If ... or is it a query? ... On that form, I guess you have controls that are, or are supposed to be, bound to the Photo fields. ...
    (microsoft.public.access.formscoding)
  • RE: Filling in form with recordset HELP
    ... Fields are bound to controls on a form, but not to the database itself. ... then bind fields from the Row Source (a table or query) to controls on the ... The example I posted is for use with an unbound form. ...
    (microsoft.public.access.formscoding)