?? form2.frm
字號:
VERSION 5.00
Begin VB.Form Form2
Caption = """計算機基礎""上機考試系統 "
ClientHeight = 4350
ClientLeft = 60
ClientTop = 390
ClientWidth = 8085
BeginProperty Font
Name = "宋體"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
ScaleHeight = 4350
ScaleWidth = 8085
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6360
TabIndex = 6
Top = 3000
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "驗證"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6360
TabIndex = 5
Top = 2040
Width = 1095
End
Begin VB.TextBox txtPwd
DataField = "考生姓名"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2160
TabIndex = 4
Top = 2880
Width = 2895
End
Begin VB.TextBox txtUser
DataField = "準考證號"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2160
TabIndex = 2
Top = 1920
Width = 2895
End
Begin VB.Label Label3
Caption = "考生姓名"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 3
Top = 3120
Width = 975
End
Begin VB.Label Label2
Caption = "準考證號"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 1
Top = 2160
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "Word操作部分"
BeginProperty Font
Name = "宋體"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 1680
TabIndex = 0
Top = 480
Width = 4695
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim step1 As Integer
Dim strCnn As String
Dim rs1 As New ADODB.Recordset
Dim cnn As ADODB.Connection
Private Sub Command1_Click()
username = ""
If txtUser.Text = "" Then
MsgBox "準考證號不能空,請輸入!", vbOKOnly + vbExclamation, "警告"
txtUser.SetFocus
Else
Set cnn = New ADODB.Connection
'打開連接
cnn.Open strCnn
rs1.Open "select * from 登陸情況 where 準考證號='" + txtUser.Text + "'", cnn, adOpenKeyset, adLockOptimistic
If rs1.RecordCount = 0 Then
MsgBox "沒有這個考生,請重新輸入準考證號!", vbOKOnly + vbExclamation, "警告"
txtUser.SetFocus
rs1.Close
Else
If txtPwd.Text = "" Then
MsgBox "考生姓名不能空,請重新輸入!", vbOKOnly + vbExclamation, "警告"
txtPwd.SetFocus
txtPwd.Text = ""
rs1.Close
ElseIf Trim(rs1.Fields(1)) = Trim(txtPwd.Text) Then
MsgBox "驗證成功,進入考試系統!", vbOKOnly + vbExclamation, "提示"
Me.Hide
Form3.Show
username = Trim(txtUser.Text)
rs1.Close
Else
MsgBox "輸入準考證號與考生姓名不匹配,請重新輸入!", vbOKOnly + vbExclamation, "警告"
txtPwd.SetFocus
txtPwd.Text = ""
rs1.Close
End If
End If
End If
End Sub
Private Sub Command2_Click()
Unload Me
Form1.Show
End Sub
Private Sub Form_Load()
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=登陸情況.mdb;Persist Security Info=False"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -