📄 frmbooksort1.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmbooksort1
BorderStyle = 3 'Fixed Dialog
Caption = "修改类别"
ClientHeight = 3090
ClientLeft = 45
ClientTop = 330
ClientWidth = 5235
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3090
ScaleWidth = 5235
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Visible = 0 'False
Begin VB.CommandButton Command1
Caption = "返 回"
Height = 375
Left = 3495
TabIndex = 9
Top = 2565
Width = 1455
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 2400
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
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=tsgl"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=tsgl"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from lbtb"
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.Frame Frame1
Caption = "修改"
Height = 2340
Left = 120
TabIndex = 0
Top = 120
Width = 4935
Begin VB.TextBox Text1
Height = 270
Left = 1320
TabIndex = 1
Top = 360
Width = 1935
End
Begin VB.TextBox Text2
Height = 270
Left = 1320
TabIndex = 2
Top = 840
Width = 1935
End
Begin VB.TextBox Text3
Height = 270
Left = 1320
TabIndex = 3
Top = 1320
Width = 1935
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 255
Left = 1320
TabIndex = 4
Top = 1800
Width = 1935
_ExtentX = 3413
_ExtentY = 450
_Version = 393216
Format = 46989313
CurrentDate = 38313
End
Begin VB.Image Image1
Height = 1410
Left = 3630
Picture = "frmbooksort1.frx":0000
Stretch = -1 'True
Top = 375
Width = 1005
End
Begin VB.Label Label4
Caption = "登记日期:"
Height = 255
Left = 360
TabIndex = 8
Top = 1800
Width = 1095
End
Begin VB.Label Label1
Caption = "类别代码:"
Height = 255
Left = 360
TabIndex = 7
Top = 360
Width = 1095
End
Begin VB.Label Label2
Caption = "书籍类别:"
Height = 255
Left = 360
TabIndex = 6
Top = 840
Width = 1095
End
Begin VB.Label Label3
Caption = "规定天数:"
Height = 255
Left = 360
TabIndex = 5
Top = 1320
Width = 1095
End
End
End
Attribute VB_Name = "frmbooksort1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Private Sub Command1_Click()
Dim lb, i As String
i = MsgBox("是否修改此条记录!", vbYesNo + vbOKOnly, "提示")
If i = vbYes Then
lb = "update lbtb set 类别代码='" & Text1 & "',书籍类别='" & Text2 & "',规定天数='" & Text3 & "'where 类别代码 like '" & Text1.Text & "'"
cnn.Execute (lb)
Else
rs.CancelUpdate
End If
frmbooksort.DataGrid1.Refresh
frmbooksort.Adodc1.Refresh
Me.Hide
End Sub
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.Open "select * from lbtb", cnn, adOpenStatic, adLockOptimistic
Me.Caption = Me.Caption & " " & frmmain.StatusBar1.Panels(2).Text
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text2.SetFocus
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Text3.SetFocus
End Sub
Private Sub text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTPicker1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -