Solved

Link to Excel at link table won't 'movenext'

Posted on 2011-03-23
2
283 Views
Last Modified: 2012-05-11
Access 2003 - I linked to an Excel 2003 spreadsheet as a 'table link'.  In code, I do this:
dim db as dao.database
dim src as dao.recordset
set db = codedb
set src = db.openrecordset("myexceltable",dbopensnapshot)
if not src.eof and not src.bof then
    src.movefirst
    do while not src.eof
          '------- code
         src.movenext
    loop
end if

The problem is, although 300+ records appear in the linked table, only 1 record is accessed by this openrecordset??
src.recordcount = 1

What's up with this?
Thanks
Scott C
0
Comment
Question by:clarkscott
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 35200527
if not src.eof then
src.movelast

msgbox src.recordcount
    src.movefirst
    do while not src.eof
          '------- code
         src.movenext
    loop
end if
0
 
LVL 20

Author Closing Comment

by:clarkscott
ID: 35200613
Thanks... That's what I needed to get through this recordset.  Without the MoveFirst AND MoveLast at the beginning of the code, when I got to the src.movenext the app errored with an 'overflow' message (??).  By adding the src.movelast, the code now loops thru the entire recordset.

Scott C
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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.

705 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