Hello,
I have an Access query that returns one record. However, using ADO I open the same query as a recordset and it gives no results(rs.EOF = true and rs.RecordCount =0??? Any ideas?
Hoping that someone has had this happen and can explain without posting all the code.
I have an Access query that returns one record. However, using ADO I open the same query as a recordset and it gives no results(rs.EOF = true and rs.RecordCount =0??? Any ideas?
Hoping that someone has had this happen and can explain without posting all the code.
Code:
Dim cn As New ADODB.Connection, i As Integer
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\MyDatabase.mdb"
cn.Open strConn
strSQL = "SELECT Act.lngRecordId FROM tblAction AS Act where strPrototype Like 'S*' And Act.lngRecordId = 1378"
Set Rs = New ADODB.Recordset
With Rs
Set .ActiveConnection = cn
.LockType = adLockOptimistic
.CursorType = adOpenDynamic
.Open strSQL
End With
'my test to see how many results--shows .EOF = true
'while my Access query has 1 results???
Do While Rs.EOF = False
'my code but no results to process???
Loop
Rs.Close
Set Rs = Nothing
Set Db = Nothing