📄 frmmodifyreaderinfo.frm
字号:
VERSION 5.00
Object = "{74848F95-A02A-4286-AF0C-A3C755E4A5B3}#1.0#0"; "actskn43.ocx"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmmodifyreaderinfo
Caption = "读者信息管理"
ClientHeight = 5235
ClientLeft = 60
ClientTop = 450
ClientWidth = 7650
LinkTopic = "Form1"
ScaleHeight = 5235
ScaleWidth = 7650
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
Height = 855
Left = 480
TabIndex = 1
Top = 4080
Width = 6615
Begin VB.CommandButton cmdmodify
Caption = "修改信息"
Height = 375
Left = 240
TabIndex = 5
Top = 240
Width = 1215
End
Begin VB.CommandButton cmdcancel
Caption = "取消"
Height = 375
Left = 5160
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.CommandButton cmdupdate
Caption = "更新"
Height = 375
Left = 3480
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.CommandButton cmddel
Caption = "删除信息"
Height = 375
Left = 1920
TabIndex = 2
Top = 240
Width = 1215
End
End
Begin VB.Frame Frame1
Height = 3855
Left = 0
TabIndex = 0
Top = 0
Width = 7455
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3495
Left = 120
TabIndex = 6
Top = 240
Width = 7215
_ExtentX = 12726
_ExtentY = 6165
_Version = 393216
HeadLines = 1
RowHeight = 15
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 = ""
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 = ""
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
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin ACTIVESKINLibCtl.Skin Skin1
Left = 0
OleObjectBlob = "frmmodifyreaderinfo.frx":0000
Top = 0
End
End
Attribute VB_Name = "frmmodifyreaderinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_reader As New ADODB.Recordset
Private Sub cmdcancel_Click()
rs_reader.CancelUpdate
DataGrid1.Refresh
DataGrid1.AllowAddNew = False
DataGrid1.AllowUpdate = False
cmddel.Enabled = True
cmdmodify.Enabled = True
cmdupdate.Enabled = False
cmdcancel.Enabled = False
End Sub
Private Sub cmdmodify_Click()
Dim answer As String
On Error GoTo cmdmodify
cmddel.Enabled = False
cmdmodify.Enabled = False
cmdupdate.Enabled = True
cmdcancel.Enabled = True
DataGrid1.AllowUpdate = True
Exit Sub
cmdmodify:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Private Sub cmdupdate_Click()
If Not IsNull(DataGrid1.Bookmark) Then
rs_reader.Update
End If
cmddel.Enabled = True
cmdmodify.Enabled = True
cmdupdate.Enabled = False
cmdcancel.Enabled = False
MsgBox "修改成功!", vbOKOnly + vbExclamation, ""
End Sub
Private Sub cmddel_Click()
Dim answer As String
'On Error GoTo cmddel
answer = MsgBox("确定要删除吗?", vbYesNo, "")
If answer = vbYes Then
DataGrid1.AllowDelete = True
rs_reader.Delete
rs_reader.Update
DataGrid1.Refresh
Else
Exit Sub
End If
'cmddel:
'MsgBox Err.Description
End Sub
Private Sub Form_Load()
Dim skn
skn = App.Path & "\Book.skn"
'载入时的一些脚本.
Skin1.LoadSkin skn
Skin1.ApplySkin Me.hWnd ' 应用皮肤到这个窗口和它的子控件中
Dim sql As String
On Error GoTo loaderror
sql = "select * from 读者信息"
rs_reader.CursorLocation = adUseClient
rs_reader.Open sql, conn, adOpenKeyset, adLockPessimistic
cmdupdate.Enabled = False
cmdcancel.Enabled = False
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
Set DataGrid1.DataSource = rs_reader
Exit Sub
loaderror:
MsgBox Err.Description
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set DataGrid1.DataSource = Nothing
rs_reader.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -