Results 1 to 2 of 2

Thread: When to use SET keyword with NEW?

  1. #1

    Thread Starter
    Addicted Member machine_wars's Avatar
    Join Date
    Dec 2000
    Location
    NC
    Posts
    147

    Question When to use SET keyword with NEW?

    What is the correct way to use SET and NEW? When I declare a NEW ADODB.RecordSet ex. Set rs = New ADODB.Recordset I know I have to use the NEW keyword but what about when I use Dim itemX As ListItem, why don't I hae to use NEW here as well ex. Set itemX = ListView1.ListItems.Add(, , rs.Fields(0), , 1).

  2. #2
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819
    The difference is that when you're creating the ADODB.Recordset you are creating an entirely new class object, using a DLL that's referred to in your references section. You also have to use the New keyword when you create instances of class objects that you have in your project as Class Modules. With the ListItem, you're only creating a internal variable.
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width