Microsoft KB Archive/149035

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

Article ID: 149035

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition

-



This article was previously published under Q149035



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.



Steps To Reproduce Issue
 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:

129801 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.  Add this function to the class module in the server project: Public Function GetDB As Object Set GetDB = OpenDatabase("Biblio.mdb") End Function  Press F5 or click Start on the Run menu to run the server application.  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  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.</ol>

Additional query words: 4.00 vb4win vb416 buglist4.00

Keywords: kbbug KB149035

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.