[讨论]速度啊,急
其中的(rs_借还信息.Open sql2, conn, adOpenKeyset, adLockPessimistic)里面的adOpenKeyset, adLockPessimistic是什么意思啊?还有If Err.Number <> 0 Then MsgBox Err.Description End If 又表示什么意思呢! 对了VB里面的Description代表什么?
Dim answer As String
On Error GoTo delerror
Dim rs_借还信息 As New ADODB.Recordset
Dim sql2 As String
sql2 = "select * from 借还信息 where 读者编号='" & rs_reader.Fields(0) & "'"
rs_借还信息.Open sql2, conn, adOpenKeyset, adLockPessimistic
If rs_借还信息.EOF = False Then
' If rs_reader.Fields(0) = rs_借还信息.Fields(0) Then
MsgBox "此人已借书,占时无法删除!"
' End If
Else
DataGrid1.AllowDelete = True
rs_reader.Delete
rs_reader.Update
DataGrid1.Refresh
MsgBox "删除成功!", vbOKOnly + vbExclamation, ""
DataGrid1.AllowDelete = False
End If
delerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
还有一个问题是 rs_reader.CursorLocation = adUseClient 不知道什么意思?最好能够把下面的三句都翻译!
谢谢!~~~~~~~
rs_reader.CursorLocation = adUseClient
rs_reader.Open sql, conn, adOpenKeyset, adLockPessimistic
Set DataGrid1.DataSource = rs_reader
rs_reader是已经定义成数据集了!~~