📄 frmkaochangxinxiweihu.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmkaochangxinxiweihu
BorderStyle = 1 'Fixed Single
Caption = "考场信息维护"
ClientHeight = 3630
ClientLeft = 45
ClientTop = 375
ClientWidth = 8895
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 3630
ScaleWidth = 8895
Begin VB.CommandButton Command8
Caption = "返回"
Height = 495
Left = 7800
TabIndex = 13
Top = 2880
Width = 975
End
Begin VB.CommandButton Command7
Caption = "删除"
Height = 495
Left = 6720
TabIndex = 12
Top = 2880
Width = 975
End
Begin VB.CommandButton Command6
Caption = "取消"
Height = 495
Left = 5640
TabIndex = 11
Top = 2880
Width = 975
End
Begin VB.CommandButton Command5
Caption = "保存"
Height = 495
Left = 4560
TabIndex = 10
Top = 2880
Width = 975
End
Begin VB.CommandButton Command4
Caption = ">>"
Height = 495
Left = 3000
TabIndex = 14
Top = 2880
Width = 855
End
Begin VB.CommandButton Command3
Caption = ">"
Height = 495
Left = 2040
TabIndex = 8
Top = 2880
Width = 855
End
Begin VB.CommandButton Command2
Caption = "<"
Height = 495
Left = 1080
TabIndex = 7
Top = 2880
Width = 855
End
Begin VB.CommandButton Command1
Caption = "<<"
Height = 495
Left = 120
TabIndex = 6
Top = 2880
Width = 855
End
Begin VB.Frame Frame1
Caption = "考场信息维护"
Height = 2535
Left = 120
TabIndex = 9
Top = 120
Width = 8655
Begin VB.TextBox Text1
Height = 375
Left = 1200
TabIndex = 0
Top = 600
Width = 2535
End
Begin VB.TextBox Text3
Height = 375
Left = 1200
TabIndex = 2
Top = 1200
Width = 2535
End
Begin VB.TextBox Text4
Height = 375
Left = 5760
TabIndex = 3
Top = 1200
Width = 2535
End
Begin VB.TextBox Text2
Height = 375
Left = 5760
TabIndex = 1
Top = 600
Width = 2535
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 495
Left = 1200
TabIndex = 4
Top = 1800
Width = 2535
_ExtentX = 4471
_ExtentY = 873
_Version = 393216
Format = 85590018
CurrentDate = 39859
End
Begin MSComCtl2.DTPicker DTPicker2
Height = 495
Left = 5760
TabIndex = 5
Top = 1800
Width = 2535
_ExtentX = 4471
_ExtentY = 873
_Version = 393216
Format = 85590018
CurrentDate = 39859
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "考试科目:"
Height = 180
Left = 240
TabIndex = 20
Top = 720
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "监考人员:"
Height = 180
Left = 240
TabIndex = 19
Top = 1320
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "监考人员职工号:"
Height = 180
Left = 4200
TabIndex = 18
Top = 1320
Width = 1440
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "考场号:"
Height = 180
Left = 4560
TabIndex = 17
Top = 720
Width = 720
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "开考时间:"
Height = 180
Left = 240
TabIndex = 16
Top = 1920
Width = 900
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "结束时间:"
Height = 180
Left = 4560
TabIndex = 15
Top = 1920
Width = 900
End
End
End
Attribute VB_Name = "frmkaochangxinxiweihu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub clearvalue()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
DTPicker1.Value = ""
DTPicker2.Value = ""
End Sub
Private Sub showvalue()
Text1.Text = rs!考试科目
Text2.Text = rs!考场号
Text3.Text = rs!监考教师姓名
Text4.Text = rs!监考教师职工号
DTPicker1.Value = rs!开考时间
DTPicker2.Value = rs!结束时间
End Sub
Private Sub Command1_Click()
If rs.RecordCount > 0 Then
rs.MoveFirst
Call showvalue
End If
End Sub
Private Sub Command2_Click()
If rs.RecordCount > 0 Then
rs.MovePrevious
If rs.BOF Then
rs.MoveFirst
MsgBox "目前已是首记录"
End If
Call showvalue
End If
End Sub
Private Sub Command3_Click()
If rs.RecordCount > 0 Then
rs.MoveNext
If rs.EOF Then
rs.MoveLast
MsgBox "目前已是尾记录"
End If
Call showvalue
End If
End Sub
Private Sub Command4_Click()
If rs.RecordCount > 0 Then
rs.MoveLast
Call showvalue
End If
End Sub
Private Sub Command5_Click()
rs!考试科目 = Text1.Text
rs!考场号 = Text2.Text
rs!监考教师姓名 = Text3.Text
rs!监考教师职工号 = Text4.Text
rs!开考时间 = DTPicker1.Value
rs!结束时间 = DTPicker2.Value
rs.Update
MsgBox "信息已保存"
End Sub
Private Sub Command6_Click()
rs.CancelUpdate
If rs.RecordCount > 0 Then
Call showvalue
Else
Call clearvalue
End If
End Sub
Private Sub Command7_Click()
If rs.RecordCount > 0 Then
If MsgBox("请确认要删除当前记录", vbYesNo) = vbNo Then Exit Sub
rs.Delete
If rs.RecordCount > 0 Then
rs.MoveNext
If rs.EOF Then
rs.MoveLast
End If
Call showvalue
Else
Call clearvalue
End If
End If
End Sub
Private Sub Command8_Click()
Unload Me
End Sub
Private Sub Form_Load()
conn.CursorLocation = adUseClient
conn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Roso;Data Source=(local)"
conn.Open
rs.Open "select * from kaochangxinxi order by 考场号", conn, adOpenStatic, adLockOptimistic
If rs.RecordCount > 0 Then
Call showvalue
Else
Call clearvalue
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Set frmkaochangxinxiweihu = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -