Forum Moderators: open

Message Too Old, No Replies

Overflowing error with ASP

overflowing error

         

Pedro Boechat

9:25 pm on Aug 20, 2003 (gmt 0)

10+ Year Member



I'm trying to make one consult and one insertion to my MS ACCESS (XP) data bank with the code below and I'm getting this error:
Microsoft JET Database Engine (0x80040E57)
Overflow

<%

set conexao = server.createobject("adodb.connection")conexao.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\Pedro\Hps\Dendell\database\dendelldb.mdb';"

strSQL = "select txt_nick from dbo_usuario"

set rs = conexao.execute(strSQL)

while not rs.eof

if rs("txt_nick") = "pedro" then

response.write ("bingo!")

else

response.write ("I'll create one - pedro - to you!")

end if

rs.movenext

wend

strSQL = "insert into dbo_usuario (txt_nome,txt_nick,txt_senha,dat_criacao,cod_permissao,txt_email,num_icq) values ('pedro','pedro','123','20/03/1998','n','pedro@pedro.com',4550317)"

conexao.begintrans

conexao.execute(strSQL) <== the error points to this line

if conexao.errors.count = 0 then

conexao.committrans

else

conexao.rollbacktrans

end if

conexao.close : set conexao = nothing

%>

I didn't find any theoretical explanation for this error.
Anyone guess what it can be?

mattglet

10:15 pm on Aug 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



do your column types match up to the data you're inserting?

Pedro Boechat

11:06 pm on Aug 20, 2003 (gmt 0)

10+ Year Member



Yes, yes...
txt_nome is a 60 character-size varchar
txt nick is a 40 character-size varchar
txt_senha is a 8 character-size varchar
cod_permissao is a 1 character-size varchar
txt_email is a 40 character-size varchar
and
num_icq is a long integer

(...)
(txt_nome,txt_nick,txt_senha,dat_criacao,cod_permissao,
txt_email,num_icq)
values ('pedro','pedro','123','20/03/1998','n','pedro@pedro.com',
4550317)
(...)

mattglet

4:10 am on Aug 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



upon quick look, it seems as if your date is 10 characters long, not 8. if you are going to be storing dates in that column, i would suggest changing the column type to date. forgive me if i'm wrong.

-Matt

Pedro Boechat

10:21 pm on Aug 22, 2003 (gmt 0)

10+ Year Member



I've already gotten what the problem was! :)
thanks anyway
The problem was occurring because an integer vartype goes from -32,768 to 32.767. So I was trying to add ICQ numbers to the database that were much greater than that, like 4550317 (that has been read as 4,550,317).
I fixed the problem changing the vartype of the field NUM_ICQ to varchar and making it accept strings with length till 11 characters :)