dbTalk Databases Forums  

Can't get all Excel records...

comp.databases.ms-access comp.databases.ms-access


Discuss Can't get all Excel records... in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Matthew Wells
 
Posts: n/a

Default Can't get all Excel records... - 05-03-2010 , 07:24 AM






I'm using Access 2007 with Windows 7 Ultimate. I'm opening an Excel sheet
with 50,000+ record using an ADO recordset. The recordset only has 38,442
records. I've tired it on a few different Excel sheets and it's always the
same (unless there's less than 38,442).

I've tried client side and server side. I've tried every possible
combination of cursor type and lock type and it's always the same. Can
anyone tell me what I'm doing wrong?

Thanks.


--
Matthew Wells
matthew.wells (AT) firstbyte (DOT) net

Reply With Quote
  #2  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: Can't get all Excel records... - 05-03-2010 , 08:43 AM






On Mon, 3 May 2010 08:24:14 -0400, "Matthew Wells"
<matthew.wells (AT) firstbyte (DOT) net> wrote:

Try linking the sheet to your database. Perhaps there really are only
so many records, and the rest are nulls or otherwise of the wrong data
type.

-Tom.
Microsoft Access MVP


Quote:
I'm using Access 2007 with Windows 7 Ultimate. I'm opening an Excel sheet
with 50,000+ record using an ADO recordset. The recordset only has 38,442
records. I've tired it on a few different Excel sheets and it's always the
same (unless there's less than 38,442).

I've tried client side and server side. I've tried every possible
combination of cursor type and lock type and it's always the same. Can
anyone tell me what I'm doing wrong?

Thanks.

Reply With Quote
  #3  
Old   
Matthew Wells
 
Posts: n/a

Default Re: Can't get all Excel records... - 05-03-2010 , 09:28 AM



I've looked at all the data in all 5 Excel files. It's consistent with no
nulls. All files return 38,442 records.


--
Matthew Wells
matthew.wells (AT) firstbyte (DOT) net

"Tom van Stiphout" <tom7744.no.spam (AT) cox (DOT) net> wrote

Quote:
On Mon, 3 May 2010 08:24:14 -0400, "Matthew Wells"
matthew.wells (AT) firstbyte (DOT) net> wrote:

Try linking the sheet to your database. Perhaps there really are only
so many records, and the rest are nulls or otherwise of the wrong data
type.

-Tom.
Microsoft Access MVP


I'm using Access 2007 with Windows 7 Ultimate. I'm opening an Excel sheet
with 50,000+ record using an ADO recordset. The recordset only has
38,442
records. I've tired it on a few different Excel sheets and it's always
the
same (unless there's less than 38,442).

I've tried client side and server side. I've tried every possible
combination of cursor type and lock type and it's always the same. Can
anyone tell me what I'm doing wrong?

Thanks.

Reply With Quote
  #4  
Old   
Rich P
 
Posts: n/a

Default Re: Can't get all Excel records... - 05-03-2010 , 10:41 AM



Hi Mathew,

with 50,000 records, it is easy to miss things with the human eye. One
thing you could do in Excel VBA is to set a Range object to the sheet's
used range and then debug.print range.rows.count to see how many rows
are in the used range

Dim rng As Range
Set rng = Sheet1.UsedRange
Debug.Print rng.Rows.Count

Note: Sheets("Sheet1") does not appear to contain the UsedRange
Property. You have to use the sheet's codename "Sheet1" (or sheet
whatever). If the used range does contain 50,000 rows then do the
following:

I would write a loop in Excel VBA against your data range against the
unique ID column (or whatever column is supposed to definitely have data
for every row) and see if there are any null rows.

Dim rng As Range, i As Integer
Set rng = Sheet1.UsedRange
For i = 1 To rng.Rows.Count
If rng(i, 1) = "" Then
rng(i, 1).Interior.ColorIndex = 38
Debug.Print "i is: " & i
End If
Next


Rich

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #5  
Old   
jbguernsey
 
Posts: n/a

Default Re: Can't get all Excel records... - 05-04-2010 , 02:55 AM



On 3 May, 13:24, "Matthew Wells" <matthew.we... (AT) firstbyte (DOT) net> wrote:
Quote:
I'm using Access 2007 with Windows 7 Ultimate. *I'm opening an Excel sheet
with 50,000+ record using an ADO recordset. * The recordset only has 38,442
records. *I've tired it on a few different Excel sheets and it's alwaysthe
same (unless there's less than 38,442).

I've tried client side and server side. *I've tried every possible
combination of cursor type and lock type and it's always the same. *Can
anyone tell me what I'm doing wrong?

Thanks.

--
Matthew Wells
matthew.we... (AT) firstbyte (DOT) net
Have you tried *importing* the data into access? You may get some
information about rows that fail to import by doing this.

HTH

JB

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.