标题:调试结果为自轨面起算的高度 多余"-21472179000"
取消只看楼主
刀客000
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-4-8
 问题点数:0 回复次数:0 
调试结果为自轨面起算的高度 多余"-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
2015-04-09 14:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-443747-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018159 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved