Strange overflow problem

dakota97

Well-known member
Joined
Nov 14, 2003
Messages
113
Location
Pennsylvania
Hi all,

Ok, this error just mysteriously appeared out of nowhere, and I have no idea what the problem is.

Im assigning a retrieved Access database value to a variable. The variable is a string, and the database value is text. But, now Im getting the ol "Arithmetic operation resulted in an overflow" error. One problem....I"M NOT DOING ANY ARITHMETIC!!!!!

Everything in the program has ran fine, and still runs fine, up until it gets to that line. No clue why, b/c it never did it before. Heres the code:


Code:
DbConn.Open()
DbCommand.CommandText = "SELECT * FROM tblVendor WHERE VName =" & cmbVendor.Text & ""
DbCommand.Connection = DbConn
DbReader = DbCommand.ExecuteReader()

If DbReader.Read Then
strVendorId = Convert.ToString(DbReader("VendorId"))   <<--Heres line error line
End If
DbReader.Close()
DbCommand.Dispose()
DbConn.Close()

Any ideas on whats going on here?

Thanks in advance,

Chris
 
Nevermind...stupid mistake...I have Option Strict turned off, and when when I declared strVendorId, I declared it as an integer. Originally I was going to make the Vendor Id a number, but I figured if people wanted to put a letter in also, then I should have it as a string...I changed the name of the variable, but not the type...oops!
 
Back
Top