📄 frmcodemain.frm
字号:
VERSION 5.00
Begin VB.Form frmDBset
Caption = "服务器设置"
ClientHeight = 2610
ClientLeft = 60
ClientTop = 345
ClientWidth = 3810
LinkTopic = "Form1"
LockControls = -1 'True
ScaleHeight = 2610
ScaleWidth = 3810
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 285
Left = 2745
TabIndex = 7
Top = 2115
Width = 915
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 285
Left = 1620
TabIndex = 6
Top = 2115
Width = 915
End
Begin VB.TextBox txtPassword
Height = 330
Left = 1035
TabIndex = 2
Top = 1485
Width = 2490
End
Begin VB.TextBox txtUser
Height = 330
Left = 1035
TabIndex = 1
Top = 900
Width = 2490
End
Begin VB.TextBox txtServer
Height = 330
Left = 1035
TabIndex = 0
Top = 270
Width = 2490
End
Begin VB.Label Label3
Caption = "密码:"
Height = 240
Left = 225
TabIndex = 5
Top = 1530
Width = 825
End
Begin VB.Label Label2
Caption = "用户名:"
Height = 240
Left = 225
TabIndex = 4
Top = 945
Width = 780
End
Begin VB.Label Label1
Caption = "服务器:"
Height = 240
Left = 225
TabIndex = 3
Top = 360
Width = 735
End
End
Attribute VB_Name = "frmDBset"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdOK_Click()
If Trim(txtServer.Text) = "" Then
MsgBox "服务器设置必须填写!", vbCritical, ERRCAPTION
txtServer.SetFocus
Exit Sub
End If
If Trim(txtUser.Text) = "" Then
MsgBox "用户名必须填写!", vbCritical, ERRCAPTION
txtUser.SetFocus
Exit Sub
End If
WriteIni "Sys", "Server", Trim(txtServer.Text), strPath
WriteIni "Sys", "User", Trim(txtUser.Text), strPath
WriteIni "Sys", "Pass", Cipher(Trim(txtPassword.Text), CODEPASSWORD), strPath
If Me.Tag = "Modify" Then
strConnection = "Provider=SQLOLEDB.1;Password=" & Trim(txtPassword.Text) & ";Persist Security Info=True;User ID=" & Trim(txtUser.Text) & ";Initial Catalog=dbSMM;Data Source=" & Trim(txtServer.Text)
Set cnnConnection = New Connection
With cnnConnection
.Close
.ConnectionString = strConnection
.CursorLocation = adUseClient
.CommandTimeout = 30
.Open
End With
End If
Unload Me
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub Form_Resize()
Select Case Me.Tag
Case "Modify"
txtServer.Text = serverName
txtUser.Text = serverName
txtPassword.Text = serverPass
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -