Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using ADODB .Find instead of DAO .Seek

Posted on 2009-04-02
6
Medium Priority
?
650 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 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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 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