Thanks for your reply. I tried a test and got the same result as you, which means I must somehow be incrementing the recordset pointer to EOF. I now know what to look for.
Code:Sub testADO() Dim rsString As String Dim num As Long Dim v As Variant rsString = "SELECT TOP 1 * FROM " & strTable Set cn = New ADODB.Connection Set rs = New ADODB.Recordset cn.Provider = strPROVIDER cn.Properties("Data Source") = [rFileDB].Value cn.Open rs.Open rsString, cn, adOpenStatic, adLockOptimistic, adCmdText num = rs.RecordCount v = rs.GetRows rs.Close cn.Close Set rs = Nothing Set cn = Nothing Debug.Print "num=" & num, "LB=" & LBound(v, 2), "UB=" & UBound(v, 2) 'num=1 LB=0 UB=0' End Sub





Reply With Quote