📄 form3.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form Form3
Caption = "修改"
ClientHeight = 6615
ClientLeft = 60
ClientTop = 450
ClientWidth = 8790
LinkTopic = "Form3"
ScaleHeight = 6615
ScaleWidth = 8790
StartUpPosition = 3 'Windows Default
Begin VB.TextBox txtFields
DataField = "ID"
DataSource = "datPrimaryRS"
Height = 405
Index = 0
Left = 2280
TabIndex = 5
Top = 360
Width = 3375
End
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 6360
Top = 4080
Visible = 0 'False
Width = 2175
_ExtentX = 3836
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame2
Caption = "操作"
Height = 3495
Left = 6480
TabIndex = 0
Top = 120
Width = 1935
Begin VB.CommandButton Command3
Caption = "删除条目"
Height = 495
Left = 240
TabIndex = 3
Top = 480
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "关闭窗口"
Height = 495
Left = 240
TabIndex = 2
Top = 2520
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确认修改"
Height = 495
Left = 240
TabIndex = 1
Top = 1440
Width = 1455
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 5040
Top = 4560
Visible = 0 'False
Width = 6000
_ExtentX = 10583
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label lblLabels
Caption = "姓名:"
Height = 255
Index = 0
Left = 360
TabIndex = 4
Top = 480
Width = 1815
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cMAx As Integer
Private Sub Command1_Click()
On Error GoTo AddErr
For i = 0 To cMAx - 1
Adodc1.Recordset.Fields(i) = Trim(txtFields(i).Text)
Adodc1.Recordset.Update
Next i
MsgBox "修改成功!"
Unload Me
GoTo sss
AddErr:
MsgBox Err.Description & "asdfsd"
sss:
End Sub
Private Sub Command2_Click()
Flag = "nothing"
Unload Me
End Sub
Private Sub Command3_Click()
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
Unload Me
End Sub
Private Sub Form_Load()
' MsgBox selectID
On Error GoTo AddErr
Me.Left = (Screen.Width - Me.Width) / 2 + 150 '使窗体居中
Me.Top = (Screen.Height - Me.Height) / 2 + 100
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\招聘信息.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tblXUESHENG where ID = '" & selectID & "'"
Adodc1.Refresh
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\招聘信息.mdb;Persist Security Info=False"
Adodc2.RecordSource = "select c from tblC "
Adodc2.Refresh
cMAx = Adodc2.Recordset.Fields(0)
Adodc2.RecordSource = "select 名称 from tblCol "
Adodc2.Refresh
'为了大小一至
lblLabels(0).Top = txtFields(0).Top
lblLabels(0).Height = txtFields(0).Height
lblLabels(0).Caption = Adodc2.Recordset.Fields(0)
Dim i As Integer
For i = 1 To cMAx - 1
Load txtFields(i)
txtFields(i).Left = txtFields(i - 1).Left
txtFields(i).Top = txtFields(i - 1).Top + txtFields(i - 1).Height + 25
txtFields(i).Visible = True
'
Load lblLabels(i)
lblLabels(i).Left = lblLabels(i - 1).Left
lblLabels(i).Top = lblLabels(i - 1).Top + lblLabels(i - 1).Height + 25
Adodc2.Recordset.MoveNext
lblLabels(i).Caption = Adodc2.Recordset.Fields(0) & ":"
lblLabels(i).Visible = True
Next
For i = 0 To cMAx - 1
If Adodc1.Recordset.Fields(i) <> "" Then
txtFields(i).Text = Trim(Adodc1.Recordset.Fields(i))
Else
txtFields(i).Text = ""
End If
Next i
GoTo sss
AddErr:
MsgBox Err.Description
sss:
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -