📄 frmaddline.frm
字号:
Begin VB.Label Label28
Caption = "站 点25:"
Height = 255
Left = 480
TabIndex = 69
Top = 6720
Width = 975
End
Begin VB.Label Label27
Caption = "站 点24:"
Height = 255
Left = 4080
TabIndex = 68
Top = 6240
Width = 975
End
Begin VB.Label Label26
Caption = "站 点23:"
Height = 255
Left = 480
TabIndex = 67
Top = 6240
Width = 975
End
Begin VB.Label Label25
Caption = "站 点22:"
Height = 255
Left = 4080
TabIndex = 66
Top = 5760
Width = 975
End
Begin VB.Label Label24
Caption = "站 点21:"
Height = 375
Left = 480
TabIndex = 65
Top = 5760
Width = 975
End
Begin VB.Label Label23
Caption = "站 点20: "
Height = 255
Left = 4080
TabIndex = 64
Top = 5280
Width = 975
End
Begin VB.Label Label22
Caption = "站 点19: "
Height = 375
Left = 480
TabIndex = 63
Top = 5280
Width = 975
End
Begin VB.Label Label21
Caption = "站 点18: "
Height = 255
Left = 4080
TabIndex = 62
Top = 4800
Width = 975
End
Begin VB.Label Label20
Caption = "站 点17: "
Height = 255
Left = 480
TabIndex = 61
Top = 4800
Width = 975
End
Begin VB.Label Label19
Caption = "站 点16: "
Height = 255
Left = 4080
TabIndex = 60
Top = 4320
Width = 975
End
Begin VB.Label Label18
Caption = "站 点15: "
Height = 255
Left = 480
TabIndex = 59
Top = 4320
Width = 975
End
Begin VB.Label Label17
Caption = "站 点14: "
Height = 255
Left = 4080
TabIndex = 58
Top = 3840
Width = 975
End
Begin VB.Label Label16
Caption = "站 点13: "
Height = 255
Left = 480
TabIndex = 57
Top = 3840
Width = 975
End
Begin VB.Label Label15
Caption = "站 点12:"
Height = 255
Left = 4080
TabIndex = 56
Top = 3360
Width = 975
End
Begin VB.Label Label14
Caption = "站 点11: "
Height = 255
Left = 480
TabIndex = 55
Top = 3360
Width = 975
End
Begin VB.Label Label13
Caption = "线路编号:"
Height = 375
Left = 480
TabIndex = 22
Top = 480
Width = 975
End
Begin VB.Label Label12
Caption = "站 点9: "
Height = 375
Left = 480
TabIndex = 21
Top = 2880
Width = 975
End
Begin VB.Label Label11
Caption = "站 点10: "
Height = 375
Left = 4080
TabIndex = 20
Top = 2880
Width = 975
End
Begin VB.Label Label10
Caption = "站 点7: "
Height = 375
Left = 480
TabIndex = 19
Top = 2400
Width = 975
End
Begin VB.Label Label9
Caption = "站 点8: "
Height = 375
Left = 4080
TabIndex = 18
Top = 2400
Width = 975
End
Begin VB.Label Label8
Caption = "站 点5: "
Height = 375
Left = 480
TabIndex = 17
Top = 1920
Width = 975
End
Begin VB.Label Label7
Caption = "站 点6: "
Height = 375
Left = 4080
TabIndex = 16
Top = 1920
Width = 975
End
Begin VB.Label Label6
Caption = "站 点4: "
Height = 375
Left = 4080
TabIndex = 15
Top = 1440
Width = 975
End
Begin VB.Label Label5
Caption = "站 点3: "
Height = 375
Left = 480
TabIndex = 14
Top = 1440
Width = 975
End
Begin VB.Label Label4
Caption = "站 点1: "
Height = 375
Left = 480
TabIndex = 13
Top = 960
Width = 855
End
Begin VB.Label Label3
Caption = "站 点2: "
Height = 375
Left = 4080
TabIndex = 12
Top = 960
Width = 975
End
Begin VB.Label Label2
Caption = "线路名称:"
Height = 375
Left = 4080
TabIndex = 11
Top = 480
Width = 975
End
End
End
Attribute VB_Name = "frmAddLine"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub cmdOK_Click()
Dim sql As String
Dim rs As ADODB.Recordset
If Trim(textNO.Text) = "" Then '判断线路编号是否为空
MsgBox "请输入线路编号!", vbOKOnly + vbExclamation, "警告"
Exit Sub
textNO.SetFocus
Else
sql = "select * from LineInfo where [NO]='" & textNO & "'"
Set rs = getRS(sql, "shujuku")
If rs.EOF = False Then '判断是否已经存在线路编号
MsgBox "这个线路编号已经存在!请重新输入线路编号!", vbOKOnly + vbExclamation, "警告"
textNO.SetFocus
textNO.Text = ""
textLineName.Text = ""
textPlat01.Text = ""
textPlat02.Text = ""
textPlat03.Text = ""
textPlat04.Text = ""
textPlat05.Text = ""
textPlat06.Text = ""
textPlat07.Text = ""
textPlat08.Text = ""
textPlat09.Text = ""
textPlat10.Text = ""
textPlat11.Text = ""
textPlat12.Text = ""
textPlat13.Text = ""
textPlat14.Text = ""
textPlat15.Text = ""
textPlat16.Text = ""
textPlat17.Text = ""
textPlat18.Text = ""
textPlat19.Text = ""
textPlat20.Text = ""
textPlat21.Text = ""
textPlat22.Text = ""
textPlat23.Text = ""
textPlat24.Text = ""
textPlat25.Text = ""
textPlat26.Text = ""
textPlat27.Text = ""
textPlat28.Text = ""
textPlat29.Text = ""
textPlat30.Text = ""
textPlat31.Text = ""
textPlat32.Text = ""
textPlat33.Text = ""
textPlat34.Text = ""
textPlat35.Text = ""
textPlat36.Text = ""
textPlat37.Text = ""
textPlat38.Text = ""
Exit Sub
Else '添加用户
sql = "insert into LineInfo ([NO],LineName,Plat01,Plat02,Plat03,Plat04,Plat05,Plat06,Plat07,Plat08,Plat09,Plat10,Plat11,Plat12,Plat13,Plat14,Plat15,Plat16,Plat17,Plat18,Plat19,Plat20,Plat21,Plat22,Plat23,Plat24,Plat25,Plat26,Plat27,Plat28,Plat29,Plat30,Plat31,Plat32,Plat33,Plat34,Plat35,Plat36,Plat37,Plat38) values('" & textNO
sql = sql & "','" & textLineName
sql = sql & "','" & textPlat01
sql = sql & "','" & textPlat02
sql = sql & "','" & textPlat03
sql = sql & "','" & textPlat04
sql = sql & "','" & textPlat05
sql = sql & "','" & textPlat06
sql = sql & "','" & textPlat07
sql = sql & "','" & textPlat08
sql = sql & "','" & textPlat09
sql = sql & "','" & textPlat10
sql = sql & "','" & textPlat11
sql = sql & "','" & textPlat12
sql = sql & "','" & textPlat13
sql = sql & "','" & textPlat14
sql = sql & "','" & textPlat15
sql = sql & "','" & textPlat16
sql = sql & "','" & textPlat17
sql = sql & "','" & textPlat18
sql = sql & "','" & textPlat19
sql = sql & "','" & textPlat20
sql = sql & "','" & textPlat21
sql = sql & "','" & textPlat22
sql = sql & "','" & textPlat23
sql = sql & "','" & textPlat24
sql = sql & "','" & textPlat25
sql = sql & "','" & textPlat26
sql = sql & "','" & textPlat27
sql = sql & "','" & textPlat28
sql = sql & "','" & textPlat29
sql = sql & "','" & textPlat30
sql = sql & "','" & textPlat31
sql = sql & "','" & textPlat32
sql = sql & "','" & textPlat33
sql = sql & "','" & textPlat34
sql = sql & "','" & textPlat35
sql = sql & "','" & textPlat36
sql = sql & "','" & textPlat37
sql = sql & "','" & textPlat38 & "')" '
Call TransactSQL(sql, "shujuku")
MsgBox "添加成功!", vbOKOnly + vbExclamation, "添加结果"
'重新设置初始化为空
textNO.Text = ""
textLineName.Text = ""
textPlat01.Text = ""
textPlat02.Text = ""
textPlat03.Text = ""
textPlat04.Text = ""
textPlat05.Text = ""
textPlat06.Text = ""
textPlat07.Text = ""
textPlat08.Text = ""
textPlat09.Text = ""
textPlat10.Text = ""
textPlat11.Text = ""
textPlat12.Text = ""
textPlat13.Text = ""
textPlat14.Text = ""
textPlat15.Text = ""
textPlat16.Text = ""
textPlat17.Text = ""
textPlat18.Text = ""
textPlat19.Text = ""
textPlat20.Text = ""
textPlat21.Text = ""
textPlat22.Text = ""
textPlat23.Text = ""
textPlat24.Text = ""
textPlat25.Text = ""
textPlat26.Text = ""
textPlat27.Text = ""
textPlat28.Text = ""
textPlat29.Text = ""
textPlat30.Text = ""
textPlat31.Text = ""
textPlat32.Text = ""
textPlat33.Text = ""
textPlat34.Text = ""
textPlat35.Text = ""
textPlat36.Text = ""
textPlat37.Text = ""
textPlat38.Text = ""
textNO.SetFocus
frmmanageLine.Show
frmmanageLine.ZOrder 0
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
textNO.Text = ""
textLineName.Text = ""
textPlat01.Text = ""
textPlat02.Text = ""
textPlat03.Text = ""
textPlat04.Text = ""
textPlat05.Text = ""
textPlat06.Text = ""
textPlat07.Text = ""
textPlat08.Text = ""
textPlat09.Text = ""
textPlat10.Text = ""
textPlat11.Text = ""
textPlat12.Text = ""
textPlat13.Text = ""
textPlat14.Text = ""
textPlat15.Text = ""
textPlat16.Text = ""
textPlat17.Text = ""
textPlat18.Text = ""
textPlat19.Text = ""
textPlat20.Text = ""
textPlat21.Text = ""
textPlat22.Text = ""
textPlat23.Text = ""
textPlat24.Text = ""
textPlat25.Text = ""
textPlat26.Text = ""
textPlat27.Text = ""
textPlat28.Text = ""
textPlat29.Text = ""
textPlat30.Text = ""
textPlat31.Text = ""
textPlat32.Text = ""
textPlat33.Text = ""
textPlat34.Text = ""
textPlat35.Text = ""
textPlat36.Text = ""
textPlat37.Text = ""
textPlat38.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -