Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using ADODB .Find instead of DAO .Seek

Posted on 2009-04-02
6
Medium Priority
?
656 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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
LVL 58
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 58
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

879 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