📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form3
Caption = "Form3"
ClientHeight = 5295
ClientLeft = 60
ClientTop = 345
ClientWidth = 6900
LinkTopic = "Form3"
ScaleHeight = 5295
ScaleWidth = 6900
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command8
Caption = "退出"
Height = 375
Left = 6000
TabIndex = 12
Top = 4680
Width = 855
End
Begin VB.CommandButton Command7
Caption = "删除"
Height = 375
Left = 5130
TabIndex = 11
Top = 4680
Width = 855
End
Begin VB.CommandButton Command6
Caption = "保存"
Height = 375
Left = 4260
TabIndex = 10
Top = 4680
Width = 855
End
Begin VB.CommandButton Command5
Caption = "放弃"
Height = 375
Left = 3420
TabIndex = 9
Top = 4680
Width = 855
End
Begin VB.CommandButton Command4
Caption = "修改"
Height = 375
Left = 2565
TabIndex = 8
Top = 4680
Width = 855
End
Begin VB.CommandButton Command3
Caption = "新增"
Height = 375
Left = 1710
TabIndex = 7
Top = 4680
Width = 855
End
Begin VB.CommandButton Command2
Caption = "下一条"
Height = 375
Left = 855
TabIndex = 6
Top = 4680
Width = 855
End
Begin VB.CommandButton Command1
Caption = "上一条"
Height = 375
Left = 0
TabIndex = 5
Top = 4680
Width = 855
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 4
Top = 3960
Width = 2415
End
Begin VB.TextBox Text1
Height = 495
Left = 2280
TabIndex = 3
Top = 3240
Width = 2415
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form3.frx":0000
Height = 2895
Left = 240
TabIndex = 0
Top = 120
Width = 6135
_ExtentX = 10821
_ExtentY = 5106
_Version = 393216
HeadLines = 1
RowHeight = 15
FormatLocked = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = "xm"
Caption = "姓名"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = "mm"
Caption = "密码"
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
ColumnWidth = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 1365.165
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 1680
Top = 240
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 2
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=qfgl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=qfgl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "czy"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label2
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 2
Top = 3960
Width = 855
End
Begin VB.Label Label1
Caption = "姓名"
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 1
Top = 3360
Width = 1095
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private bc As Integer
Private Sub Command1_Click()
If Adodc1.Recordset.BOF Then
MsgBox ("库中没有记录!!")
Exit Sub
End If
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF = True Then
MsgBox ("首记录!!")
Adodc1.Recordset.MoveFirst
If Adodc1.Recordset.BOF = True Then
MsgBox ("库中没有记录!!")
Exit Sub
End If
End If
Text1.Text = Adodc1.Recordset!xm
Text2.Text = Adodc1.Recordset!mm
End Sub
Private Sub Command2_Click()
If Adodc1.Recordset.EOF Then
MsgBox ("库中没有记录!!")
Exit Sub
End If
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True And Adodc1.Recordset.BOF = True Then
MsgBox ("库中没有记录!!")
Text1.Text = ""
Text2.Text = ""
Exit Sub
ElseIf Adodc1.Recordset.EOF = True Then
MsgBox ("末记录!!")
Adodc1.Recordset.MovePrevious
End If
Text1.Text = Adodc1.Recordset!xm
Text2.Text = Adodc1.Recordset!mm
End Sub
Private Sub Command3_Click()
bc = 1
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = False
Command8.Enabled = False
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command4_Click()
bc = 2
Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = False
Command8.Enabled = False
End Sub
Private Sub Command5_Click()
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = True
Command8.Enabled = True
End Sub
Private Sub Command6_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox ("项目没有录全,不能保存!!")
Exit Sub
End If
If bc = 1 Then
Adodc1.Recordset.AddNew
Adodc1.Recordset!xm = Text1.Text
Adodc1.Recordset!mm = Text2.Text
Else
Adodc1.Recordset!xm = Text1.Text
Adodc1.Recordset!mm = Text2.Text
End If
Command1.Enabled = True
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = False
Command6.Enabled = False
Command7.Enabled = True
Command8.Enabled = True
End Sub
Private Sub Command7_Click()
If Adodc1.Recordset.BOF = True Or Adodc1.Recordset.EOF = True Then
MsgBox ("当前记录为空,不能删除!!")
Exit Sub
End If
Adodc1.Recordset.Delete
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command8_Click()
Unload Me
End Sub
Private Sub Form_Load()
Command5.Enabled = False
Command6.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -