Eugene (yg********@hotmail.com) writes:
I have a field: usercode [tinyint]
In Query Analyzer:
UPDATE tblUserProcess
SET usercode = 1002
Result: Error "Arithmetic overflow error for data type tinyint, value =
1002.
The statement has been terminated."
In VBA/Access ( linked to SQL Server ):
intOptions = 512
pstrQuerySQL = "UPDATE ..."
CurrentDb.Execute pstrQuerySQL, intOptions
Result: no errors, insert value 223 (???)
Why?
If the string you pass from the VBA app really is
"UPDATE tblUserProcess SET usercode = 1002", then there is something
really fishy going on.
I can see a couple of possibilities:
1) You have poor error handling in the VBA code, so you fail to catch
the error. The column already had the value 223 prior to the UPDATE.
2) The statement is parameterized, and the VBA code loses the upper bits
of 1002. In such case you get 224. Is 223 a typo?
More information would be useful.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp