调试结果为自轨面起算的高度 多余"-21472179000"
程序代码:
Private Sub Command7_Click() Dim connectionstring As String Dim rs As New Recordset Dim X As Integer Dim x5 As Integer Dim Y As Integer X = Val(Text29.Text) Y = Val(Text51.Text) connectionstring = "provider=microsoft.Jet.oledb.4.0;" & "data source=铁路超限货物装载计算机辅助决策系统.mdb" conn.Open connectionstring sql = "select * from 机车车辆限界、各级超限限界与建筑限界距离线路中心线所在垂直平面尺寸表 where 自轨面起算的高度(mm)='" & X & "'" rs.Open sql, conn Select Case X Case 360 To 1100 Select Case Y Case 1600 To 1650 MsgBox "二级超限" Case 1650 To 1875 MsgBox "三级超限" Case Else MsgBox "不超限" End Select Case 1210 To 1240 Select Case Y Case 1600 To 1650 MsgBox "二级超限" Case 1650 To 2440 MsgBox "三级超限" Case Else MsgBox "不超限" End Select Case 1250 To 3000 Select Case Y Case 17000 To 1900 MsgBox "一级超限" Case 1900 To 1940 MsgBox "二级超限" Case 1940 To 2440 MsgBox "三级超限" Case Else MsgBox "不超限" End Select Case Else If X Mod 10 = 0 Then Select Case Y Case rs.Fields(1) To rs.Fields(2) MsgBox "一级超限" Case rs.Fields(2) To rs.Fields(3) MsgBox "二级超限" Case rs.Fields(3) To rs.Fields(4) MsgBox "三级超限" Case Else MsgBox "不超限" End Select End If If X Mod 10 <> 0 Then x5 = Fix(X / 10) * 10 + 10 Select Case Y Case rs.Fields(1) To rs.Fields(2) MsgBox "一级超限" Case rs.Fields(2) To rs.Fields(3) MsgBox "二级超限" Case rs.Fields(3) To rs.Fields(4) MsgBox "三级超限" End Select End If End Select rs.Close End Sub