数据类型varchar转换为numeric时出错,高分求教!!!!!!
pesci 2002-10-15 06:36:29 数据类型varchar转换为numeric时出错,高分求教!!!!!!请各路高手帮忙.
出错提示:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC SQL Server Driver][SQL Server]将数据类型 varchar 转换为 numeric 时出错。
/modify/accesstosql.asp, line 47
原代码:
.....
rs2.Open sql,myconn,3
dim quantity1
dim price1
do while not rs2.EOF
'sql="insert "&request("totable")&" (username,model,mfg,quantity,price,introduce,uploadtime,datecode) values ('"&request("username")&"','"&rs2("model")&"','"&rs2("mfg")&"','"&rs2("quantity")&"','"&rs2("price")&"','"&rs2("introduce")&"',getdate(),'"&rs2("datecode")&"')"
if rs2("quantity")<0 or trim(rs2("quantity"))="" then
quantity1=1
else
quantity1=rs2("quantity")
end if
' if trim(rs2("price"))="" then
' price1=0
' else
' price1=rs2("price")
' end if
'sql="insert "&request("totable")&" (username,model,mfg,quantity,price,introduce,uploadtime,datecode) values ('"&request("username")&"','"&rs2("HD74HC74FP")&"','"&rs2("HIT")&"',"&quantity&","&price&",'"&rs2("SOP-14")&"',getdate(),'"&rs2("N5")&"')"
sql="insert "&request("totable")&" (username,success,instock,reserve,model,mfg,quantity,uploadtime) values ('"&request("username")&"','1','1','y','"&rs2("model")&"','"&rs2("mfg")&"','"&quantity1&"',getdate())"
' sql="update "&request("totable")&" set introduce='"&rs2("note")&"' where model='"&rs2("model")&"'"
Response.Write (sql)
' response.end
conn.execute(sql)
rs2.MoveNext
loop
.....