|
-
Oct 19th, 2000, 07:53 PM
#1
Thread Starter
Lively Member
I do not understand why some objects are referenced using the new operator and some objects aren't.
For example:
If one uses DAO for connecting to databases, in order to declare a database object, you just have to use the Dim statment:
Dim db as database
But if one uses ADO, one has to declare the connection object with the new statment:
set db = NEW ADODB.connection
how can the DAO object be refferenced with out creating it using the NEW statement?
Thanks.
Dan.
-
Oct 20th, 2000, 10:36 AM
#2
Using a New keyword is a term for early binding. means that Object created as soon as you declare it.
Here's is what MSDN has to say about it:
New -
Keyword that enables implicit creation of an object. If you use New when declaring the object variable, a new instance of the object is created on first reference to it, so you don't have to use the Set statement to assign the object reference. The New keyword can't be used to declare variables of any intrinsic data type, can't be used to declare instances of dependent objects, and can’t be used with WithEvents.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|