Re: VB6 - Using Unbound Controls

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




"Bob Barnes" <BobBarnes@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CEFC4FBB-8D28-46C4-ADAD-2D8D162397AC@xxxxxxxxxxxxxxxx
I am an Access Developer maintaining a VB6 Fronting Access 2003, which
someone else wrote.

The VB6 Forms use Data Controls and ADO. I've learned VB6 Forms can't
"mix"
both DAO and ADO.

Within Access, I've always used DAO because it works well, so I've never
made an ADP (Access Data Project). I've developed Access Apps w/ Unbound
Controls using DAO for almost 6 years, and they work great.

A 3rd-Party Developer has asked me to populate a New Access Table w/
selected data from the Field data saved by the Data Control in the VB6
Front-end. After updating the existing Table Recordset w/ the Data
Controls,
can I use ADO thru my existing connection to the Access Back-end, and save
the "3rd-party desired data" (used in a Realtime Display on his software)
using SQL Statements like I do now in my Access Apps w/ Unbound Controls?

If so, any code samples would be welcome.

TIA - Bob

Just to clarify. A VB app can internally use both the ADO and DAO data
libraries at the same time. The issue is attempting to bind a DAO-based
control with ADO sources and vice-versa. So like you noted if a Form
contains ADO-based controls then you can only use DAO in an unbounded mode.

Unbounded simply means looping though a recordset/source and filling the
control by hand as well as managing all the changes. (With ADO controls you
will also want to capture events to massage the data.) Each control has its
own particular features and limitations so it isn't possible to provide a
OSFA solution. But once you discover exactly what control you are dealing
with, a quick google search should turn up hundreds if not thousands of
examples. Note: code showing how to use DAO with a DAO control unbounded
will be little different than if using a ADO control.

At the risk of confusing you further, there are other issues to consider. If
you are using MS Access (Jet) locally DAO has definite performance
advantages over ADO. But you lose some of this when you go to an unbounded
mixed environment (DAO source -> ADO control). You can gain some of it back
if you use an ADO source bound to an ADO control. (cf, ADO source unbounded
to an ADO control). Therefore you might want to migrate to a straight ADO
solution, or maybe not. <g> You have to test within your problem domain.

To muddy the waters further, you might consider wrapping your current DAO
code within DataSource classes and use them to bind to the ADO controls.
Thus employing that most ancient of programming truism- "there is no problem
that can't be solved with another level of indirection". <g>

-ralph
[Before anyone decides to flame me... "Performance" is totally dependent on
what one is doing, volume, frequency, providers, cursors, etc. To make any
blanket statement concerning "performance" and database access is to invite
a ton of exceptions.]


.



Relevant Pages

  • Re: Optional Arguments in Sub Procedure
    ... DAO, ADO and ADO.Net are simply different methods for getting at data. ... from a Jet data source to another data source, you should use ADO right from ... I'd make it accept 1 control and 1 boolean value, ...
    (microsoft.public.access.gettingstarted)
  • Re: VB6 - Using Unbound Controls
    ... The VB6 Forms use Data Controls and ADO. ... Within Access, I've always used DAO because it works well, so I've never ... I've developed Access Apps w/ Unbound ... selected data from the Field data saved by the Data Control in the VB6 ...
    (microsoft.public.vb.general.discussion)
  • Re: 525 Data Access Error - German Version of Windows
    ... it is the DAO Control causing the problem... ... a test program using the ADO control on to her computer. ... The ADO data ...
    (microsoft.public.vb.database.dao)
  • Re: VB6 Winsock action on Server
    ... With the introduction on your part of ADO and DBMS. ... to be used to connect and manage data flow between client and DB? ... I think the issue is namely how to control concurrent access. ...
    (microsoft.public.vb.general.discussion)
  • Re: ADO control and SQL Session
    ... In my testing, if I open a VBA form with ADO control, sp_who ... I closed the form,reopen it, the number of sql session ... I close the ADO record set connection ...
    (microsoft.public.vb.controls)