📄 登入.frm
字号:
VERSION 5.00
Begin VB.Form Form5
Caption = "登入"
ClientHeight = 4755
ClientLeft = 60
ClientTop = 450
ClientWidth = 5790
LinkTopic = "Form5"
ScaleHeight = 4755
ScaleWidth = 5790
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 495
Left = 480
TabIndex = 3
Text = "在此处输入你的SQL SEVER 服务器名称"
Top = 1800
Width = 4815
End
Begin VB.CommandButton Command2
Caption = "退出"
Height = 495
Left = 3960
TabIndex = 2
Top = 3840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "登入"
Height = 495
Left = 3960
TabIndex = 0
Top = 2880
Width = 1215
End
Begin VB.Label Label1
Caption = "教师工资管理系统 "
ForeColor = &H00FF0000&
Height = 495
Left = 360
TabIndex = 1
Top = 360
Width = 4215
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim Constr As String
'以下为连接字符串
Constr = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=教师基本信息表;Data Source=" '
Constr = Constr & Me.Text1.Text
Comsalary.ConnectionString = Constr
'打开ADO连接
Comsalary.Open
ResClose = 1
ResOpen = 0
Unload Me
'游标的活动连接为ADO控件COMSALARY
Form1.Show
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_load()
Me.Command1.Enabled = False
End Sub
Private Sub Text1_Click()
Me.Text1.Text = ""
Me.Text1.SetFocus
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If Trim(Me.Text1.Text) = "" Then
Me.Command1.Enabled = False
Else
Me.Command1.Enabled = True
If KeyCode = 13 Then
Me.Command1.Enabled = True
Call Command1_Click
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -