Overflow error 6

O

OldEnough

I need a bit of guidance for an overflow error . Example follows:
Dim db as DAO.Database
Set db = CurrentDB
Dim rs as DAO.Recordset
Dim strSQL as String
strSQL = "SELECT Mytable.Field1, Mytable.Field2, Mytable.Field3 FROM Mytable"
SET rs = dbOpenRecordset(strSQL,dbOpenDynaset)
fault occurs here (Overflow Error #6)
The table has around 133K records, though recordset only needs 3 (long
integer)fields .

Is there a way to use this approach with some modification? Can someone
suggest a workaround or a better approach?
 
S

Stuart McCall

OldEnough said:
I need a bit of guidance for an overflow error . Example follows:
Dim db as DAO.Database
Set db = CurrentDB
Dim rs as DAO.Recordset
Dim strSQL as String
strSQL = "SELECT Mytable.Field1, Mytable.Field2, Mytable.Field3 FROM
Mytable"
SET rs = dbOpenRecordset(strSQL,dbOpenDynaset)
fault occurs here (Overflow Error #6)
The table has around 133K records, though recordset only needs 3 (long
integer)fields .

Is there a way to use this approach with some modification? Can someone
suggest a workaround or a better approach?

"dbOpenRecordset" - if that is your actual code, not just a typo in your
message, then that's probably it. Although why it should throw an overflow I
don't know. Anyhow, it should be:

db.OpenRecordset
 
O

OldEnough

Thanks Stuart
I discovered my mistake, though the typo you pointed out would have
caused an error also. While the recordset was valid, as I processed the
results I had coded a variable as integer instead of long. Eventually a
record was processed that contained a result that was too large to be an
integer value.
 
T

Tony Toews [MVP]

OldEnough said:
I discovered my mistake, though the typo you pointed out would have
caused an error also. While the recordset was valid, as I processed the
results I had coded a variable as integer instead of long. Eventually a
record was processed that contained a result that was too large to be an
integer value.

Thanks for posting back your solution. That wasn't at all obvious.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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