Solved

Using ADODB .Find instead of DAO .Seek

Posted on 2009-04-02
6
645 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
[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
  • 2
6 Comments
 
LVL 58

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

623 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