Solved

Problem using DAO and ADO together

Posted on 1999-01-27
3
161 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
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now