BUG: Use of 16-bit Client & DAO Object Causes Error '8002802b'

Last reviewed: April 16, 1996
Article ID: Q149035
The information in this article applies to:
  • Professional and Enterprise Editions of Microsoft Visual Basic, 16-bit only, for Windows, version 4.0

SYMPTOMS

Assigning a passed DAO object to a specific object variable fails with error "8002802b" when using the 16-bit edition of Microsoft Visual Basic version 4.0 for Windows. This error occurs on either the client or server side, if the DAO object in question has been passed from the other application.

WORKAROUND

Declare the variable(s) that hold the references to the passed object with "As Object" instead of "As Database" or "As Recordset". The code that manipulates these "As Object" variables does not need to change.

STATUS

Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps To Reproduce Issue

  1. Create a minimal OLE server and a client that accesses the OLE server. To obtain step-by-step instructions on how to accomplish this functionality, please see the following article in the Microsoft Knowledge Base:

    ARTICLE-ID: Q129801

       TITLE     : How to Create and Use a Minimal OLE Automation Server
    
       For clarity purposes, the following steps assume a client and server
       created from the article referenced above. However, these steps can be
       implemented in any client and server to see the behavior described in
       this article.
    
    

  2. Add this function to the class module in the server project:

          Public Function GetDB() As Object
    
             Set GetDB = OpenDatabase("Biblio.mdb")
          End Function
    
    

  3. Press F5 or click Start on the Run menu to run the server application.

  4. Change the Form_Click event in the client application to contain this code:

          Private Sub Form_Click()
    
             Dim x As Object
             Dim db As Database
             Dim rs As Recordset
    
             Set x = CreateObject("Project1.Class1")
             Set db = x.GetDB
             Set rs = db.OpenRecordset("Authors")
          End Sub
    
    

  5. Press F5 or click Start on the Run menu to run the client application. Click on the form to execute the code added in step 4. The client returns the above mentioned error on the line calling the GetDB method of the server. If you change the declare for the db variable from "As Database" to "As Object" this line executes successfully. However, the next line fails with the same error, as the rs variable is declared "As Recordset." Changing the rs variable to "As Object" corrects this problem and the code runs to completion correctly.


KBCategory: kbprg kbbuglist
KBSubcategory: APrgDataOther IAPOLE
Additional reference words: 4.00 vb4win vb416 buglist4.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.