[求助]程序中"更新"错在那里
这段代码主要用于修改后的更新操作:把DataGrid1中当前行当前列的数据写入STUDENT表中,
Private Sub Cmdok_Click()
On Error GoTo errHandler:
With Dataenv.rsstudent
.Fields("Serial") = DataGrid1.Columns(0).CellText(DataGrid1.Bookmark)
.Fields("name") = DataGrid1.Columns(1).CellText(DataGrid1.Bookmark)
.Fields("sex") = DataGrid1.Columns(2).CellText(DataGrid1.Bookmark)
.Fields("class") =DataGrid1.Columns(3).CellText(DataGrid1.Bookmark)
.Fields("birthday") =DataGrid1.Columns(4).CellText(DataGrid1.Bookmark)
.Fields("tel") = DataGrid1.Columns(5).CellText(DataGrid1.Bookmark)
.Fields("address") =DataGrid1.Columns(6).CellText(DataGrid1.Bookmark)
.Fields("resume") = DataGrid1.Columns(7).CellText(DataGrid1.Bookmark)
.Update
End With
errHandler:
MsgBox Err.Description, vbCritical, " 错误"
End Sub
错误:对象关闭时不应许操作,
正确的打开语句应该怎么写?
[此贴子已经被作者于2006-5-9 13:50:18编辑过]