Solved

Problem using DAO and ADO together

Posted on 1999-01-27
3
170 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Controlled Assessment GCSE - desperate help needed 4 85
Firemonkey DbLookupComboBox equivalent ? 2 47
Help me. 3 55
vbModal 12 52
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

777 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