Solved

Using ADODB .Find instead of DAO .Seek

Posted on 2009-04-02
6
633 Views
Last Modified: 2013-11-27
Hi.  I just upgraded everybody's PC to Office 2007, only to find that all the DAO stuff I had written in  MS Access no longer works.  I have a camp sales table with a composite primary key composed of a 2 byte integer and a 7 byte session id.  I used to do:
Sales.Seek "PrimaryKey", sess & Id
then do
If Sales.Nomatch ...
Neither .Seek or .Nomatch work any more

I was trying searchstr = "PrimaryKey = " & sess & Id, and then checking for EOF, but this doesn't seem to be the right syntax when I do:
Sales.Find searchstr, , adSearchForward

Can someone help, please?

Chuck Greenslit


0
Comment
Question by:cgreenslit
  • 3
  • 2
6 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 24052716
In 2007, ADO is the default, but you can get your DAO stuff working by simply including the DAO reference.  Open a module in design view, click tools/references, then scroll down to "Microsoft Data Access Objects 3.6" and check it.  Make sure it's listed before the ADO lib in the reference list.
 
JimD.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 24052740
other thing to remember is how did you define the datatypes in the first place
eg
dim db as database

or

dim db as dao.database

0
 
LVL 77

Expert Comment

by:peter57r
ID: 24052885
"In 2007, ADO is the default,"

Not here it ain't....

The only default refrence is to (the new) DAO.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 57
ID: 24052927
<<The only default refrence is to (the new) DAO.>>
Really?  I wasn't aware they switched it back...I don't understand why their DAO calls are not working then.
JimD.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 24053238
In A2007 DAO is the main thing.  The new features are only handled in DAO - not in ADO.
I don't understand why the original code won't work.
It's not clear - and perhaps Chuck will clarify- whether it is giving errors or not running?
0
 
LVL 57
ID: 24115539
Chuck,
  Not sure why you awarded me an answer, as I was clearly off base.   Did you get you problem resolved or were you just trying to get the question closed?  If the latter, this should have been deleted as there is no solution.
JimD.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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