📄 frmsetdb.frm
字号:
VERSION 5.00
Begin VB.Form frmSetDB
BorderStyle = 1 'Fixed Single
Caption = "数据库配置"
ClientHeight = 4965
ClientLeft = 45
ClientTop = 330
ClientWidth = 6900
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4965
ScaleWidth = 6900
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox PicCaption
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 720
Left = 0
Picture = "frmSetDB.frx":0000
ScaleHeight = 720
ScaleWidth = 9600
TabIndex = 10
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 9600
Begin VB.PictureBox PicBorder
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 150
Left = 0
Picture = "frmSetDB.frx":16844
ScaleHeight = 150
ScaleWidth = 1050
TabIndex = 11
TabStop = 0 'False
Top = 0
Visible = 0 'False
Width = 1050
End
End
Begin VB.CommandButton cmdExit
Caption = "关 闭"
Height = 495
Left = 3720
TabIndex = 9
Top = 3660
Width = 1575
End
Begin VB.CommandButton cmdSetting
Caption = "设 置"
Height = 495
Left = 1380
TabIndex = 8
Top = 3660
Width = 1575
End
Begin VB.TextBox txtDBPassword
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2700
PasswordChar = "*"
TabIndex = 6
Top = 2640
Width = 2055
End
Begin VB.TextBox txtDBUserName
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2700
TabIndex = 4
Top = 2160
Width = 2055
End
Begin VB.TextBox txtDBName
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2700
TabIndex = 2
Top = 1680
Width = 2055
End
Begin VB.TextBox txtDBServerName
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2700
TabIndex = 1
Top = 1200
Width = 2055
End
Begin VB.Label Label4
Caption = "数据库"
Height = 255
Left = 1920
TabIndex = 7
Top = 1740
Width = 795
End
Begin VB.Label Label3
Caption = "密 码"
Height = 255
Left = 1920
TabIndex = 5
Top = 2700
Width = 795
End
Begin VB.Label Label2
Caption = "用户名"
Height = 255
Left = 1920
TabIndex = 3
Top = 2220
Width = 795
End
Begin VB.Label Label1
Caption = "服务器"
Height = 255
Left = 1920
TabIndex = 0
Top = 1260
Width = 795
End
End
Attribute VB_Name = "frmSetDB"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload frmSetDB
End Sub
Private Sub cmdSetting_Click()
On Error Resume Next
Dim sDBServerName As String
Dim sDBUserName As String
Dim sDBPassword As String
Dim sDBName As String
If Len(txtDBServerName) = 0 Then
MsgBox "服务器名不能为空!", vbInformation, "错误警告"
Exit Sub
ElseIf Len(txtDBName) = 0 Then
MsgBox "数据库名不能为空!", vbInformation, "错误警告"
Exit Sub
ElseIf Len(txtDBUserName) = 0 Then
MsgBox "数据库用户名不能为空!", vbInformation, "错误警告"
Exit Sub
ElseIf Len(txtDBPassword) = 0 Then
MsgBox "数据库密码不能为空!", vbInformation, "错误警告"
Exit Sub
End If
Call WriteINIFile("DBInfo", "DBServerName", txtDBServerName)
Call WriteINIFile("DBInfo", "DBName", txtDBName)
Call WriteINIFile("DBInfo", "DBUserName", txtDBUserName)
Call WriteINIFile("DBInfo", "DBPassword", txtDBPassword)
sDBServerName = GetINIFile("DBInfo", "DBServerName")
sDBUserName = GetINIFile("DBInfo", "DBUserName")
sDBPassword = GetINIFile("DBInfo", "DBPassword")
sDBName = GetINIFile("DBInfo", "DBName")
If sDBServerName <> "" And sDBUserName <> "" And sDBPassword <> "" And sDBName <> "" Then
MsgBox "数据库配置成功!", vbInformation, "配置结果"
Else
MsgBox "数据库配置失败!请稍后再试!", vbInformation, "配置结果"
End If
End Sub
Private Sub Form_Load()
Skin Me, m_cN
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -