就说这段代码到底到底应该该成什么样
Private Sub Command2_Click()
If (DataGrid1.Row = -1) Then
MsgBox "请选择要查看的学生"
Else
Dim rs As adodb.Recordset
Set rs = New adodb.Recordset
selrow = DataGrid1.Row
rs.Open sqlstr, "provider=Microsoft.Jet.OLEDB.4.0;Data source =" & App.Path & "/database/db1.mdb;Jet OLEDB:Database Password=7886475", adOpenStatic, adLockOptimistic
rs.Move selrow
rs.Delete
rs.Update
datagridset
End If
End Sub
Private Function datagridset()
Adodc1.RecordSource = sqlstr
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
End Function