求助 用 VB 调用 access 数据库时使用的是 ADO 刷新时总出现多步操作错误 求大神
Private Sub Command1_Click()Adodc1.Recordset.AddNew
Text1.SetFocus
Text1 = "": Text2 = "": Text3 = "": Text4 = "": Text5 = "": Text6 = "": Text7 = "": Text8 = "": Text9 = "": Text10 = ""
Text11 = Date & "/" & Time
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Delete
End Sub
Private Sub Command4_Click()
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
MsgBox "已经是第一条了", vbOKCancel, "提示"
Else
Adodc1.Recordset.MovePrevious
End If
End Sub
Private Sub Command5_Click()
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox "已经是最后一条了", vbOKCancel, "提示"
Else
Adodc1.Recordset.MoveNext
End If
End Sub
Private Sub Command6_Click()
Adodc1.Recordset.Update
End Sub
Private Sub Command7_Click()
End
End Sub
Private Sub Form_Load()
Adodc1.Visible = False
Adodc1.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0 ; Data source =" & App.Path & "\可燃气体与有毒气体.mdb "
Adodc1.RecordSource = "select * from 气化可燃气体与有毒气体"
Adodc1.Refresh
= adCmdUnknown
Set Text1.DataSource = Adodc1
Set Text2.DataSource = Adodc1
Set Text3.DataSource = Adodc1
Set Text4.DataSource = Adodc1
Set Text5.DataSource = Adodc1
Set Text6.DataSource = Adodc1
Set Text7.DataSource = Adodc1
Set Text8.DataSource = Adodc1
Set Text9.DataSource = Adodc1
Set Text10.DataSource = Adodc1
Set Text11.DataSource = Adodc1
Text1.DataField = "ID"
Text2.DataField = "设备编号"
Text3.DataField = "类型"
Text4.DataField = "位号"
Text5.DataField = "所在位置"
Text6.DataField = "一阶报警点"
Text7.DataField = "二阶报警点"
Text8.DataField = "ScaleL"
Text9.DataField = "ScaleH"
Text10.DataField = "信道"
Text11.DataField = "添加时间"
End Sub
求大神指点