Private SQLBasicString As String
Private SQLVariableString As String
Dim varBmk As Variant
Private mtimes As Integer, mloop As Integer
Private Sub Command1_Click()
Set AcBankRecordset = New ADODB.Recordset
SQLBasicString = "select * from AcBank order by BankNo"
SQLVariableString = SQLBasicString
With AcBankRecordset
Set .ActiveConnection = AccountConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
.Open SQLVariableString
End With
Set DataGrid1.DataSource = AcBankRecordset
End Sub
這個command我一直按,程式都不會錯誤, 一個recordset在沒有 set 成nothing 或close 的情況下,竟可重複Set AcBankRecordset = New ADODB.Recordset , 是不是意味著我們可以不必 管recordset c的close 及nothing..請指教..謝謝