Solved

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

Posted on 2011-03-23
2
294 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
[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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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 …

726 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