Puzzling Question

  • Thread starter Thread starter Beebs
  • Start date Start date
B

Beebs

I'm using Peter's InTheHand ADOCE, but my problem has nothing to do
with that. I've been using the same database and code for months, now
suddenly I get the following error:

An unhandled exception of type 'System.InvalidCastException' occurred
in Microsoft.VisualBasic.dll

Additional information: Operator is not valid for type 'DBNull' and
type 'Integer'.

At this line of code:

If rsCheck.Fields("ScannedID").Value Is DBNull.Value Then

Why would I suddenly get this error after months of running it
successfully? The field in my cdb is a Long Integer, and that hasn't
changed from day one. Anyone have any ideas?

Thanks
 
Unfortunately, I still get the same error. Obviously something else
is going on with integers and null types. It really doesn't make
sense why I suddenly can't check a field which is an integer type, to
see if it's null...it just doesn't add up.
 
Set a breakpoint at that line and dump the recordset field to the COmmand
window. What is it's actual type?
 
Back
Top