PC Review


Reply
Thread Tools Rate Thread

DAO data control or DAO instantiation

 
 
the_grove_man@yahoo.com
Guest
Posts: n/a
 
      8th Nov 2005
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?

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      8th Nov 2005
Your post doesn't seem to have to do with ADO.NET as you are asking about
DAO and ADO and using VB 6.0 syntax.



<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
>



 
Reply With Quote
 
John Grove
Guest
Posts: n/a
 
      8th Nov 2005


Yes, I apologize, I asked this question in the wrong group. Yes I am
referring to VB6.

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Time instantiation of user control =?Utf-8?B?TUJyeWdh?= Microsoft Dot NET 0 8th Nov 2004 09:40 PM
Instantiation Tommy Malone Microsoft VB .NET 0 20th May 2004 04:44 PM
mysteries of instantiation dennist Microsoft ADO .NET 2 17th Nov 2003 10:37 AM
Control IE popup from excel VBA instantiation jonathan Microsoft Excel Programming 0 29th Oct 2003 09:09 PM
Fine control over type instantiation Ben Blair Microsoft Dot NET Framework 2 17th Sep 2003 11:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 PM.