Re: DAO (Instantiate as Object or use the Data Control)



The Data Control is a feature, a native, built-in control, of the separate
Visual Basic language -- you may well be using an Access (Jet) database with
VB, but it is highly unlikely that you are using a VB Data Control with an
application created in Access. In Access, binding is different, the Record
Source is bound to the Form, and individual Fields in the Form's Record
Source may be bound directly to Controls such as Text Boxes, and Combo
Boxes. Access developers neither have nor use a Data Control, and, thus, you
aren't likely to get the best answer to your questions here -- you need to
find a newsgroup that deals with VB, and, if possible, databases. I know
there used to be a USENET newsgroup, comp.lang.basic.visual.databases but
don't know if anyone posts there or monitors it, anymore -- even after
splitting the USENET VB newsgroups some years back, most still posted their
questions to comp.lang.basic.visual.misc.

Check the free news server, news.microsoft.com, for sponsored newsgroups
about VB.

Larry Linson
Microsoft Access MVP


<the_grove_man@xxxxxxxxx> wrote in message
news:1131468434.949617.181320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I guess my question can go in two directions. I create applications
> that run multiple queries against a database. Generally speaking in the
>
> past I have used a Data Control (calling it dat1) making it invisible
> and have used this whenever i needed it.
>
> dat1.databasename = app.path & "mydatabase.mdb"
> dat1.recordsource = "my query"
> dat1.refresh
>
> Lately I have seen that most programmers instantiate this when they
> need it. For example, in typical DAO style.
>
> dim db as database
> set db = OpenDatabase(app.path & "\mydatabase.mdb")
>
> dim rs as recordset
> set rs = OpenRecordsets("my table or query")
>
> My question is this. Is it better to instantiate it whenever I use it
> or just use one control throughout my program and re-open it when I
> need it. Which is better on memory?
>
> My question is not just for DAO, ADO also has a data control or I can
> instantiate that as well.
>
> Which is better on memory?
>


.



Relevant Pages

  • DAO data control or DAO instantiation
    ... that run multiple queries against a database. ... Lately I have seen that most programmers instantiate this when they ... Which is better on memory? ... My question is not just for DAO, ADO also has a data control or I can ...
    (microsoft.public.dotnet.framework.adonet)
  • DAO (Instantiate as Object or use the Data Control)
    ... that run multiple queries against a database. ... Lately I have seen that most programmers instantiate this when they ... Which is better on memory? ... My question is not just for DAO, ADO also has a data control or I can ...
    (comp.databases.ms-access)
  • Re: Any alternative to a Data Control?
    ... "third dialog box" in the Data Wizard where it asks to ... I finally got the Data Control to work. ... datasource but does not refresh with changes. ... The extra work required to deal with database in classic VB is one major ...
    (comp.lang.basic.visual.misc)
  • Re: Help - Access with VB
    ... No, there are a few different ways to access data in a database, but the ... data control is probably the easiest. ... connection, command and recordset objects, initialising these to ... string should look something like: ...
    (microsoft.public.access.queries)
  • Re: Class not registered
    ... > How can he only have Dao360.dll and be able to connect to the database and ... > then when he access the form containing the Data Control and DBGrid he has ...
    (microsoft.public.vb.database.ado)