Results 1 to 5 of 5

Thread: Collection Problem

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Collection Problem

    hey
    am using an object as a collection
    i declare it in a module as global, the problem is if i insert the values manually it works fine but when i try to insert values from a database using a recordset and when i try to access it, it says "Object no longer valid"

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Collection Problem

    Post what you are doing...on the surface, I don't know why you would be having a problem.

  3. #3
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Collection Problem

    I think you might be adding a reference to the recordset itself - not the actual records. Put each record into a string and then add the string to the collection.

    Does this help?
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  4. #4
    Fanatic Member Bombdrop's Avatar
    Join Date
    Apr 2001
    Location
    St Helens, England, UK
    Posts
    667

    Re: Collection Problem

    Have you looked at using a Collection Class???

  5. #5
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: Collection Problem

    Quote Originally Posted by hyousuf2
    hey am using an object as a collection
    i declare it in a module as global,
    This in itself is the source of many problems. You should make it a Private member of your main Form, and give it Public Accessors. That way, you always know when it's available. In your case, it is likely you are using it when it is not available.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

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