|
-
Mar 30th, 2005, 06:38 AM
#1
Thread Starter
Addicted Member
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"
-
Mar 30th, 2005, 06:58 AM
#2
Re: Collection Problem
Post what you are doing...on the surface, I don't know why you would be having a problem.
-
Mar 30th, 2005, 07:08 AM
#3
Fanatic Member
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]
-
Mar 30th, 2005, 08:02 AM
#4
Fanatic Member
Re: Collection Problem
Have you looked at using a Collection Class???
Useful Links
.Net
#Develop, GhostDoc, CodeKeep , be.PINVOKE, Good Code Snippet Site
Krypton Toolkit, XPCC / XP Common Controls, QSS Windows Forms Components
VB.COM
VB.Classic Help File, MB Controls, MZTools, ADO Stored Procedure Generator add-in,
-
Mar 30th, 2005, 08:49 AM
#5
Re: Collection Problem
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|