User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 14 Apr 2005, 21:18   #1
Howie17
Registered User
 
Join Date: Apr 2005
Posts: 5
Howie17 is an unknown quantity at this point
VB6 - Runtime Error '91'

Run-time error '91':

Object variable or With block variable not set.



Hey guys,

I'm currently creating a program for a Salon, basically they need a program requiring alot of database stuff, from appointments to inventory. Well in the process of programming it, i've run into this run-time error and have had no luck in troubleshooting it in VB or through google searches. I've found answers on google but they haven't been able to help me fix my case of it.

When the error appears and i choose to 'Debug' it points to:

adoSeats.Recordset.MoveFirst

I now am getting the same error on two forms, both relating to ADO objects as far as i can tell.
If i make the command creating the error a comment it continues on through the code and when it runs into the next instance of the ADO object i get the error again.

Due to this I think i have the "Object Variable not set" portion of the error msg. But what does that mean? heh

If anyone could help me out, I'd REALLY appreciate it. Thanks.


*Edit: Also, I've checked the linking of the ADO object from the database to it, and to the text fields/data grids i've been using and they all appear to be fine.
Howie17 is offline   Reply With Quote
Unread 14 Apr 2005, 21:38   #2
JetLinus
Friendly geek of GD :-/
 
JetLinus's Avatar
 
Join Date: Nov 2000
Location: On my metal roid
Posts: 923
JetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud ofJetLinus has much to be proud of
Arrow Re: VB6 - Runtime Error '91'

Well, this is one of the most frequent VB runtime errors you can get.

Unfortunately, it's sort of "generic", and basically can be anything.
It usually happens when you're using "third party stuff", or external components. I've never seen it happen in native VB.



So, it's basically that what it says: You're trying to use functions from an "object", that doesn't exist.
Check:
- Are all (type?)libraries included correctly? Correct versions? No collisions etc?
Project, Porperties, References...

The other thing is, that unfortunately from my experience, when doing COM stuff with VB, the auto complete doesn't work, and you've got to work "blind" with the objects (some get-DHTML-object-from-IE stuff was what I tried).
So you don't exactly know what sub-objects are set or do exist or even how the methods are spelled...


Sooooooo: Is adoSeats.Recordset.MoveFirst really correct syntax? Are the references for this ADO section up2date and correct? Any OCX needed?

Try to test it step by step. Try a method from Recordset that should defenitely work. If that doesn't help, try one from adoSeats....

Oh and btw, look into the dim-statement, if New is present or not, i can cause stuff:
Dim Object as [new] Thing
__________________
[»] Entropy increases! :-/
JetLinus is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 00:25.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018