?? frmserver.frm
字號:
VERSION 5.00
Begin VB.Form frmServer
BorderStyle = 3 'Fixed Dialog
Caption = "設置 SQL 服務器"
ClientHeight = 2715
ClientLeft = 45
ClientTop = 330
ClientWidth = 4560
Icon = "frmServer.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 181
ScaleMode = 3 'Pixel
ScaleWidth = 304
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin SuperMarket.FTextBox txtUser
Height = 300
Left = 1080
TabIndex = 1
Top = 720
Width = 3315
_ExtentX = 5847
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "宋體"
FontSize = 9
AutoSelAll = -1 'True
End
Begin SuperMarket.XPButton cmdExit
Cancel = -1 'True
Height = 345
Left = 3300
TabIndex = 5
Top = 2220
Width = 1095
_ExtentX = 1931
_ExtentY = 609
Caption = "取消"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Mode = 0
Value = 0 'False
cBack = -2147483633
End
Begin SuperMarket.XPButton cmdOK
Default = -1 'True
Height = 345
Left = 2100
TabIndex = 4
Top = 2220
Width = 1095
_ExtentX = 1931
_ExtentY = 609
Caption = "確定"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "新宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Mode = 0
Value = 0 'False
cBack = -2147483633
End
Begin SuperMarket.FTextBox txtServer
Height = 300
Left = 1080
TabIndex = 0
Top = 240
Width = 3315
_ExtentX = 5847
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "宋體"
FontSize = 9
AutoSelAll = -1 'True
End
Begin SuperMarket.FTextBox txtPW
Height = 300
Left = 1080
TabIndex = 2
Top = 1200
Width = 1995
_ExtentX = 3519
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "宋體"
FontSize = 9
PasswordChar = "*"
AutoSelAll = -1 'True
End
Begin SuperMarket.FTextBox txtDB
Height = 300
Left = 1080
TabIndex = 3
Top = 1680
Width = 3315
_ExtentX = 5847
_ExtentY = 529
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontName = "宋體"
FontSize = 9
AutoSelAll = -1 'True
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "數據庫:"
Height = 180
Left = 240
TabIndex = 11
Top = 1755
Width = 720
End
Begin VB.Label lbPW
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "(密碼已隱藏)"
Height = 180
Left = 3240
TabIndex = 10
Top = 1275
Visible = 0 'False
Width = 1080
End
Begin VB.Label lbCT
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "測試連接中..."
ForeColor = &H00FF0000&
Height = 180
Left = 240
TabIndex = 9
Top = 2295
Visible = 0 'False
Width = 1170
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 碼:"
Height = 180
Left = 240
TabIndex = 8
Top = 1275
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "服務器:"
Height = 180
Left = 240
TabIndex = 7
Top = 315
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用戶名:"
Height = 180
Left = 240
TabIndex = 6
Top = 795
Width = 720
End
End
Attribute VB_Name = "frmServer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'超市銷售系統
'程序開發:lc_mtt
'CSDN博客:http://blog.csdn.net/lc_mtt/
'個人主頁:http://www.3lsoft.com
'郵箱:3lsoft@163.com
'注:此代碼禁止用于商業用途。有修改者發我一份,謝謝!
'---------------- 開源世界,你我更進步 ----------------
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
On Error GoTo aaaa
If txtServer.Text = "" Then
MsgBox "必須填寫 SQL 服務器名稱或 IP 地址。", vbInformation
txtServer.SetFocus
Exit Sub
End If
If txtUser.Text = "" Then
MsgBox "必須填寫 SQL 服務器的用戶名。", vbInformation
txtUser.SetFocus
Exit Sub
End If
If txtDB.Text = "" Then
MsgBox "必須填寫數據庫的名稱。", vbInformation
txtDB.SetFocus
Exit Sub
End If
lbCT.Visible = True
DoEvents
Dim cnTest As New ADODB.Connection
sqlConnect cnTest, txtServer.Text, txtUser.Text, txtPW.Text, txtDB.Text
MsgBox "連接 " & txtServer.Text & " 成功!", vbInformation
cnTest.Close
SaveServer txtServer.Text, txtUser.Text, txtPW.Text, txtDB.Text
readServer
Unload Me
Exit Sub
aaaa:
MsgBox Err.Description, vbCritical
lbCT.Visible = False
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -