注册 登录
编程论坛 VB6论坛

求助vb编程中出现的问题

狂飙的蜗牛1 发布于 2015-05-19 11:58, 416 次点击
Dim f As Double
Dim f1 As Double
Dim f2 As Long
Dim e1 As Double
Dim j As Double
Dim sql2 As String
sql2 = "select * from  集中载荷表 where 车型='" & Trim(Combo1.Text) & "'"
rs_find2.CursorLocation = adUseClient
rs_find2.Open sql2, conn, adOpenKeyset, adLockPessimistic
f = Val(Text1.Text)
rs_find2.MoveFirst
Do While Not rs_find2.EOF
j = rs_find2.Fields("容许载重(t)")
e1 = j - f
If e1 >= 0 Then
Exit Do
End If
rs_find2.MoveNext
Loop
rs_find.MovePrevious
f2 = rs_find2.Fields("平车地板负重面长度(mm)")
f1 = rs_find2.Fields("容许载重(t)")
c = 1000 * (f - f1) / (j - f1) + f2
Label9.Caption = c

老是显示c = 1000 * (f - f1) / (j - f1) + f2溢出 请大家帮帮忙
4 回复
#2
lianyicq2015-05-19 12:08
f f1 f2 j 都有定义,不知c是如何定义的.
在溢出的这句加个断点,看看各变量值到底是多少.
#3
狂飙的蜗牛12015-05-19 12:23
c是double

取出的值f1和j相同
#4
wp2319572015-05-19 13:47
有没有可能 除数无限接近于0
#5
cc21910152015-05-19 21:04
看看
1