📄 formsetupdb.frm
字号:
Begin VB.TextBox TxtMin
Height = 270
Index = 3
Left = 3120
MaxLength = 3
TabIndex = 55
Top = 1440
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtQyName
Height = 270
Index = 3
Left = 1080
TabIndex = 54
Top = 1440
Visible = 0 'False
Width = 1935
End
Begin VB.TextBox TxtMax
Height = 270
Index = 2
Left = 3600
MaxLength = 3
TabIndex = 53
Top = 1080
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtMin
Height = 270
Index = 2
Left = 3120
MaxLength = 3
TabIndex = 52
Top = 1080
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtQyName
Height = 270
Index = 2
Left = 1080
TabIndex = 51
Top = 1080
Visible = 0 'False
Width = 1935
End
Begin VB.TextBox TxtMax
Height = 270
Index = 1
Left = 3600
MaxLength = 3
TabIndex = 50
Top = 720
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtMin
Height = 270
Index = 1
Left = 3120
MaxLength = 3
TabIndex = 49
Top = 720
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtQyName
Height = 270
Index = 1
Left = 1080
TabIndex = 48
Top = 720
Visible = 0 'False
Width = 1935
End
Begin VB.TextBox TxtMax
Height = 270
Index = 0
Left = 3600
MaxLength = 3
TabIndex = 47
Top = 360
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtMin
Height = 270
Index = 0
Left = 3120
MaxLength = 3
TabIndex = 46
Top = 360
Visible = 0 'False
Width = 375
End
Begin VB.TextBox TxtQyName
Height = 270
Index = 0
Left = 1080
TabIndex = 45
Top = 360
Visible = 0 'False
Width = 1935
End
Begin VB.Label LabName
Caption = "区域五:"
Height = 255
Index = 4
Left = 240
TabIndex = 44
Top = 1840
Visible = 0 'False
Width = 735
End
Begin VB.Label LabName
Caption = "区域四:"
Height = 255
Index = 3
Left = 240
TabIndex = 43
Top = 1480
Visible = 0 'False
Width = 735
End
Begin VB.Label LabName
Caption = "区域三:"
Height = 255
Index = 2
Left = 240
TabIndex = 42
Top = 1120
Visible = 0 'False
Width = 735
End
Begin VB.Label LabName
Caption = "区域二:"
Height = 255
Index = 1
Left = 240
TabIndex = 41
Top = 760
Visible = 0 'False
Width = 735
End
Begin VB.Label LabName
Caption = "区域一:"
Height = 255
Index = 0
Left = 240
TabIndex = 40
Top = 400
Visible = 0 'False
Width = 735
End
End
Begin VB.Frame Frame4
Caption = "区域设置"
Height = 735
Left = 0
TabIndex = 34
Top = 240
Width = 4215
Begin VB.VScrollBar Vs1
Height = 375
Left = 1920
Max = 0
Min = 5
TabIndex = 37
Top = 300
Width = 255
End
Begin VB.TextBox TxtQuYuNum
Height = 270
Left = 1200
Locked = -1 'True
TabIndex = 36
Text = "0"
Top = 360
Width = 615
End
Begin VB.Label Label12
Caption = "最多5个区域"
Height = 255
Left = 2280
TabIndex = 38
Top = 405
Width = 1215
End
Begin VB.Label Label11
Alignment = 1 'Right Justify
Caption = "区域数量:"
Height = 255
Left = 240
TabIndex = 35
Top = 405
Width = 975
End
End
End
End
Attribute VB_Name = "FormSetupDb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdCancel_Click()
If isDataBaseErr = True Then
End
Else
Unload Me
End If
End Sub
Private Sub CmdOk_Click()
Dim x As Integer
Call SetToRam
uDb.closeConn
uDb.openConn
If uDb.MyState <> 1 Then
MsgBox "数据库无法正常连接,请修改数据库信息!"
Exit Sub
End If
If isDataBaseErr = True Then
Call FormMain.SaveSetup
MsgBox "数据库设置成功,请重新启动!"
End
End If
Call FormMain.SaveSetup
Call uDb.exeData("delete * from QuYu")
For x = 0 To 4
If TxtMin(x).Visible = True Then
Call uDb.exeData("insert into QuYu (Name,iMin,iMax) values('" & TxtQyName(x) & "'," & TxtMin(x) & "," & TxtMax(x) & ")")
Else
Exit For
End If
Next
Unload Me
End Sub
Sub LoadQuYu()
Dim x As Long
Dim y As Integer
x = uDb.rsData("select * from QuYu")
Vs1.Value = x
With uDb.rsPub
For y = 0 To 4
If Not .EOF Then
TxtQyName(y) = !Name
TxtMin(y) = !iMin
TxtMax(y) = !iMax
.MoveNext
Else
Exit Sub
End If
Next
End With
End Sub
Private Sub Form_Load()
Me.Width = 4530
Fram(1).Move Fram(0).Left, Fram(0).Top
Fram(2).Move Fram(0).Left, Fram(0).Top
If isDataBaseErr = True Then
Call OptType_Click(1)
Else
Call OptType_Click(0)
End If
Call SetToTxt
Call LoadQuYu
End Sub
Private Sub OptType_Click(Index As Integer)
Select Case Index
Case 0
Fram(0).Visible = True
Fram(1).Visible = False
Fram(2).Visible = False
Case 1
Fram(0).Visible = False
Fram(1).Visible = True
Fram(2).Visible = False
Case 2
Fram(0).Visible = False
Fram(1).Visible = False
Fram(2).Visible = True
End Select
End Sub
Sub SetToTxt()
TxtNode = sNode
TxtLand = sLand
TxtInteval = iSaveInteval
TxtFixPath = sFixPath
OptUseServerTime(0).Value = isUseServerTime
OptUseServerTime(1).Value = Not OptUseServerTime(0).Value
OptDbType(0).Value = uDb.isSql
OptDbType(1).Value = Not OptDbType(0).Value
TxtDbServer = uDb.dbServer
TxtDbUser = uDb.dbUser
TxtDbPass = uDb.dbPass
TxtDbName = uDb.dbName
TxtDbFile = uDb.dbFile
End Sub
Sub SetToRam()
sNode = TxtNode
sLand = TxtLand
iSaveInteval = TxtInteval
sFixPath = TxtFixPath
isUseServerTime = OptUseServerTime(0).Value
uDb.isSql = OptDbType(0).Value
uDb.dbServer = TxtDbServer
uDb.dbUser = TxtDbUser
uDb.dbPass = TxtDbPass
uDb.dbName = TxtDbName
uDb.dbFile = TxtDbFile
End Sub
Private Sub Vs1_Change()
Dim x As Integer
TxtQuYuNum.Text = Vs1.Value
For x = 1 To 5
If x > Vs1.Value Then
LabName(x - 1).Visible = False
TxtQyName(x - 1).Visible = False
TxtMin(x - 1).Visible = False
TxtMax(x - 1).Visible = False
Else
LabName(x - 1).Visible = True
TxtQyName(x - 1).Visible = True
TxtMin(x - 1).Visible = True
TxtMax(x - 1).Visible = True
End If
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -