Solved

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

Posted on 2011-03-23
2
290 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How Can I Grab This Information off a PDF Form 23 48
Calculation in Access 5 26
MS Access Delete All Excel sheets 1 8
My SQL as Backend for Access 3 14
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 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