| 发表于:2007-01-25 23:39:21 楼主 |
数据类型为decimal(38,20) 存储过程为 create proc proc_test_add @id int, @quantity decimal(38,20) as set nocount on begin insert into test(id,quantity) values(@id,@quantity) end vb代码为 dim cmd as new command dim prm as new parameter set cmd.activeconnection = cn cmd.commandtype = adcmdstoredproc cmd.commandtext = "proc_test_add " set prm = cmd.createparameter( "pid ", adinteger, adparaminput, 4, text1.text) cmd.parameters.append prm set prm = cmd.createparameter( "pquantity ", addouble, adparaminput, 20, text2.text) cmd.parameters.append prm cmd.EXECute 假设text2.text的值为1.00259时,在保存到表时会变成1.00259000000000010000 请问为什么? 可是如果这样: cn.EXECute "insert into test(id,quantity) values( " & text1.text & ", " & text2.text & ") " 就会保持原数! |
|
|
|
|