The information in this article applies to:
SYMPTOMSAn "Object not an Array" error results when you reference a field of a dynaset, table, or snapshot object in a form or module that does not contain a Set statement for that dynaset, table, or snapshot. The error occurs when Visual Basic attempts to compile your program. CAUSEThis error is caused by a parsing problem in the Visual Basic programming environment. The Visual Basic parser does not recognize the object type because there is no Set statement in the same form or module. WORKAROUNDAdd a dummy Sub procedure to each form or module, and use a Set statement that refers to the global database / table / dynaset in a meaningful way (for example, Set myds = db.CreateDynaset(...) not set myDs = myDs). Give the Sub procedure a name like 'AAAAA_Fix_Parser' so it becomes the first code parsed in that form or module. Make sure the dynaset set in the dummy Sub procedure is the exact same dynaset that is causing the problem. When adding more than one dummy Sub procedure to a project, give each Sub procedure a different name (AAAAA1, AAAAA2, and so on) to avoid name collisions that could complicate your existing problem. For example, use the following dummy procedure if MyDs is the dynaset causing the problem:
You never need to execute the code in the Sub procedure or even call the
Sub procedure. Once you add the Sub procedure, the parser sees the Set
statement(s) before it tries to parse any other code, so it does not have
trouble with the global objects. After adding the Sub procedure, you do not
have to tweak the code every time you reload the project; you can do it
once and save it.
STATUSMicrosoft has confirmed this to be a bug in Microsoft Visual Basic version 3.0 for Windows. This bug was corrected in Microsoft Visual Basic version 4.0 for Windows. MORE INFORMATIONSteps to Reproduce Problem
Additional query words: buglist3.00 fixlist4.00 3.00
Keywords : |
Last Reviewed: August 19, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |