Private Sub Command3_Click()
Dim SQL As String
Dim CN4 As New ADODB.Connection
Dim RS4 As New ADODB.Recordset
Set CN4 = New ADODB.Connection
Set RS4 = New ADODB.Recordset
CN4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\Student.mdb "
CN4.Open
Set RS4.ActiveConnection = CN4
RS4.CursorLocation = adUseClient
RS4.CursorType = adOpenForwardOnly
SQL = "Select * from idea where result='已处理'"
RS4.Open SQL
Adodc1.RecordSource = SQL
Adodc1.Refresh
If RS4.EOF And RS4.BOF Then
MsgBox "没有您要查的记录!"
End If
RS4.Close
Set RS4 = NothingEnd Sub
Adodc1.Refresh-----------------------系统提示这条语句错了,“对象refresh的IADODC失败”?????????????
还有select语句错了?????????????
Dim SQL As String
Dim CN4 As New ADODB.Connection
Dim RS4 As New ADODB.Recordset
Set CN4 = New ADODB.Connection
Set RS4 = New ADODB.Recordset
CN4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\Student.mdb "
CN4.Open
Set RS4.ActiveConnection = CN4
RS4.CursorLocation = adUseClient
RS4.CursorType = adOpenForwardOnly
SQL = "Select * from idea where result='已处理'"
RS4.Open SQL
Adodc1.RecordSource = SQL
Adodc1.Refresh
If RS4.EOF And RS4.BOF Then
MsgBox "没有您要查的记录!"
End If
RS4.Close
Set RS4 = NothingEnd Sub
Adodc1.Refresh-----------------------系统提示这条语句错了,“对象refresh的IADODC失败”?????????????
还有select语句错了?????????????
RS4.Open SQL
'加上这句试试
adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data\Student.mdb "Adodc1.RecordSource = SQL
RS4.Open SQL ,adopenkeyset,adlockreadonly
If rs4.recordcount=0 Then
MsgBox "没有您要查的记录!"
End If
RS4.Close
Set RS4 = Nothing