?? form2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
BackColor = &H00FF8080&
BorderStyle = 4 'Fixed ToolWindow
Caption = "服務器連接"
ClientHeight = 2205
ClientLeft = 5985
ClientTop = 3870
ClientWidth = 4680
ControlBox = 0 'False
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2205
ScaleWidth = 4680
ShowInTaskbar = 0 'False
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 2280
MaxLength = 16
PasswordChar = "*"
TabIndex = 12
Top = 3120
Width = 1695
End
Begin VB.CommandButton Command1
BackColor = &H00FFFF80&
Caption = "登錄"
Height = 375
Left = 1560
Style = 1 'Graphical
TabIndex = 11
Top = 3840
Width = 1095
End
Begin VB.CommandButton Command2
BackColor = &H00FFFF80&
Caption = "取消"
Height = 375
Left = 2640
Style = 1 'Graphical
TabIndex = 10
Top = 3840
Width = 1095
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2280
Style = 2 'Dropdown List
TabIndex = 9
Top = 2520
Width = 1695
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 270
Left = 2040
TabIndex = 0
Top = 360
Width = 1695
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
Height = 270
Left = 2040
TabIndex = 1
Top = 720
Width = 1695
End
Begin VB.TextBox Text4
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 3
Top = 1080
Width = 1695
End
Begin VB.Line Line1
BorderColor = &H8000000F&
BorderWidth = 2
X1 = 0
X2 = 4680
Y1 = 2280
Y2 = 2280
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "用戶名"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000F&
Height = 255
Left = 1320
TabIndex = 14
Top = 2520
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密 碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000F&
Height = 255
Left = 1320
TabIndex = 13
Top = 3120
Width = 735
End
Begin VB.Image Image1
Height = 360
Left = 720
Picture = "Form2.frx":0000
Stretch = -1 'True
Top = 2520
Width = 360
End
Begin VB.Image Image2
Height = 360
Left = 720
Picture = "Form2.frx":058A
Stretch = -1 'True
Top = 3000
Width = 360
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "服務器"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 840
TabIndex = 8
Top = 360
Width = 855
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "用戶名"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 840
TabIndex = 7
Top = 720
Width = 735
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "密 碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 255
Left = 840
TabIndex = 6
Top = 1080
Width = 735
End
Begin VB.Label Label6
BackColor = &H00FFFFC0&
BackStyle = 0 'Transparent
Caption = "正在連接服務器..."
Height = 255
Left = 360
TabIndex = 5
Top = 1680
Width = 1695
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = " 連接"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2160
MouseIcon = "Form2.frx":1254
MousePointer = 99 'Custom
TabIndex = 4
Top = 1680
Width = 855
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = " 取消"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3120
MouseIcon = "Form2.frx":155E
MousePointer = 99 'Custom
TabIndex = 2
Top = 1680
Width = 855
End
Begin VB.Shape Shape1
BackColor = &H00C0E0FF&
BackStyle = 1 'Opaque
Height = 375
Left = 2160
Shape = 4 'Rounded Rectangle
Top = 1560
Width = 855
End
Begin VB.Shape Shape2
BackColor = &H00C0E0FF&
BackStyle = 1 'Opaque
Height = 375
Left = 3120
Shape = 4 'Rounded Rectangle
Top = 1560
Width = 855
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1 = "" Then
MsgBox "請輸入密碼!", vbOKOnly + vbInformation, "提示"
Text1.SetFocus
Exit Sub
End If
Call adoopen
sql = "select * from xiaoshouman where xiaono='" & Combo1.Text & "'and xiaopw='" & Text1 & "'"
Call rs(sql)
If Not adors.EOF Then
user = adors.Fields("xiaono")
Call adoclose
Unload Form8
Unload Me
Form1.WindowState = 2
Form1.Show
Else
MsgBox "密碼錯誤,請重新輸入", vbOKOnly + vbInformation, "提示"
Text1 = ""
Text1.SetFocus
Call adoclose
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Move MDIForm1.Left + (MDIForm1.Width - Me.Width) / 2, MDIForm1.Top + 3000
End Sub
Private Sub Label7_Click()
On Error GoTo aaaa
If Text2.Text = "" Then
MsgBox "必須填寫 SQL 服務器名稱或 IP 地址。", vbInformation, "提示"
Text2.SetFocus
Exit Sub
End If
If Text3.Text = "" Then
MsgBox "必須填寫 SQL 服務器的用戶名。", vbInformation, "提示"
Text3.SetFocus
Exit Sub
End If
Label6.Visible = True
DoEvents
Dim cnTest As New ADODB.Connection
sqlConnect cnTest, Text2.Text, Text3.Text, Text4.Text
Label6.Caption = "連接 " & Text2.Text & " 成功!"
strSQLServer = Text2
strSQLUser = Text3
strSQLPW = Text4
cnTest.Close
'sql = "select mno from manager"
'Call comadd(sql, "mno", Combo1)
'Me.Height = 4245
Me.Height = 4785
sql = "select xiaono from xiaoshouman"
Call comadd(sql, "xiaono", Combo1)
Exit Sub
aaaa:
MsgBox err.Description, vbCritical
Label6.Visible = False
End Sub
Private Sub Label8_Click()
Unload MDIForm1
End
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -