Overflow error

G

Greg Nelson

I have an ADO (VBA) query that runs against SQL Server
with no problem, in this case extracting 96,000 records
that IO am able to loop thru with no problem. However
when I write these records to an Access2002 table (using
Addnew and Update) I get an OVERFLOW error (err.number=6)
when I hit record 32,767. DoEvents doesnt help. Any
ideas anybody ?
 
J

John Spencer (MVP)

Sounds as if you've Dimmed the Loop variable as an integer (max value 32K). Try
Dimming the loop variable as a Long.

Dim lngCount As Long

For lngCount = 1 to SomeMaxNumber
'Do stuff
Next lngcount

Without seeing the code (or at least relevant snippets) this is a guess. But
almost for sure you have a variable or value that should be type Long and you
have it as type integer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top