Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Losing DAO Object References in VB6 User Controls
Message
 
À
28/01/1999 09:39:29
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00181293
Message ID:
00181373
Vues:
10
>I have some code that was working fine last week. Since then I have installed SQL 7 and Crystal Reports 7 on this machine. I have DAO objects (Database Objects and Querydef Objects) that are created and set at load as global for this module. I later try to reference these objects, and I get Run-time error '91' - Object Variable or With Block variable not set. Odd thing is, this used to work fine, and there is no basis for this message as the Object was created at startup and has not been destroyed since. I found this in several places in my code with no apparent reason for it to fail. I can bring up the Immediate Mode window and execute the function that originally set up the global objects, and then everything is fine ( and it is indeed being called at startup as it should). It's almost as if I am suddenly in a different instance of the User Control (even though I am not). Very strange and frustrating behavior. If anyone has any ideas as to why this may be happening I would
>love to hear from you at gman@ubix.com. Even better if you have a solution!
>
>Thanks in advance to all who reply!

Did you try to put DAO in front of you type declaration (only to make that VB takes the good library).

Dim MyDB as DAO.Database
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform