Solved

Problem using DAO and ADO together

Posted on 1999-01-27
3
176 Views
Last Modified: 2013-11-23
We are currently converting a large VB Project from DAO to ADO. For a limited period of time, we need to use DAO and the VB DAO Data Control to bind our grids to. For the detail data we use already ADO (both DAO and ADO via jet). What we found is, that when we update the database via ADO, it takes around 5 seconds until we can access the new data with a DAO.Openrecordset. Is there any way we can make sure that ADO really flushes the data to the database and that DAO is able to read the data right after it has been written by ado?
0
Comment
Question by:infosysgmbh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1470933
There is a registry setting in HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\3.5\Engines\Jet 3.5 called PageTimeout. This number is in millisecs. By default, it is 5000 (which means five seconds). You can reduce this number and restart DAO.
0
 
LVL 1

Expert Comment

by:devashanti
ID: 2949999
There are issues with combining DAO and ADO. I've been stumbling into them myself. I'd suggest checking out some articles on the Advisor.com website. Search for keyword ADO.

I've also been working with Microsoft's support because there's so little valid information in their help - I'm finding that in many cases their sample code provides only the DAO methods; or what seems to be conflicting methods; but as it turns out there are several correct ways to code ADO controls. Which only confuses me more.

What database and version are you using? (There are also some known issues with DAO code and Access 2000.) Are you sure you have the right provider selected in your data environment properties? And that you've correctly set up the command properties for datamembers? I've found optomistic locking works best.

ADO, if it's set up correctly will automatically write new and edited data to the database when a user moves from one field or row to another. But the method used by ADO causes conflicts when also using DAO controls and code. If you're able to commit data via ADO controls but it's taking too long to read that data with DAO controls I'd guess there is some conflict with the conflicts with your connection methods as you're actually accessing the database via two different connections.

Also since ADO allows you to define rowsource, rowmember and listfield properties for populating lists in the DataList and DataCombo controls and define different datasource, datamember and datafield properties for the data tables to save data to; and DAO doesn't alloow this, it could be another area of conflict.

Fortunately for me, my application isn't very complex yet, so I'm trying to go back a re-do forms where I used DAO so my application will be completely ADO.

Based on what I've been discovering about DAO to ADO conversions, I think if I had to convert a large complex application from DAO to ADO I'd do it as a major version update and not release a version with combined methods. I'd wait to release until everything is converted to ADO.
0
 
LVL 1

Expert Comment

by:Netlink2
ID: 12036363
Thui, you're a legend, I spent 3 days trying to fix a problem using SQL commands and ADO in a program. I was getting the error "Could not update, currently locked". It fixed most of my problems.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question