Solved

Using ADODB .Find instead of DAO .Seek

Posted on 2009-04-02
6
642 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 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

751 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