PRB: Data Control Only Displays Updated Data when Single-Stepping Through Code (248833)



The information in this article applies to:

  • Microsoft Visual Basic Professional Edition for Windows 5.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 5.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

This article was previously published under Q248833

SYMPTOMS

When you run an application, updates made to an .mdb file are not visible when you refresh the intrinsic Visual Basic DAO Data Control. When you single-step through the code, the changes show up in the Data Control.

CAUSE

Your code and the data control are instantiating two different versions of the Microsoft Jet database engine and you experience symptoms similar to those described in the following Knowledge Base article: For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

216925 PRB: Single-User Concurrency Problems With ADO and Jet

With DAO and the DAO data control, this is caused by having the Microsoft DAO 3.5 (or 3.51 or 2.5/3.5 Compatibility) library lower in the list of type library references than another type library that defines a Database and recordset object for a different version of Microsoft Jet database engine. The effect of this is to cause two different versions of Microsoft Jet database engine to be loaded.

RESOLUTION

Move the Microsoft DAO 3.51 type library up in priority to just under the Visual Basic type libraries.

You should also be able to work around the problem by declaring an unambiguous variable type, such as DAO.Database and DAO.Recordset instead of database and recordset:
Dim db As DAO.Database, rs As DAO.Recordset
				

STATUS

This behavior is by design.


Modification Type:MinorLast Reviewed:7/28/2003
Keywords:kbDatabase kbJET kbMDACNoSweep kbprb KB248833 kbAudDeveloper