The database is Access 2000.
I am attempting to assign the recordset returned from the Getrows method directly to an array as per the following code.
This avoids having to explicitly declare a recordset object and clean it up etc.
This works successfully if there are records returned,however, if there are no records to be returned, it fails with "Either BOF or EOF is true or the current record has been deleted".
It fails on the Execute command without giving giving the opportunity to test the contents of the array.
Is there a way to do this, or do I have t go through the whole recordset declaration etc.
Thanks
The risk with keeping an open mind is having your brains fall out.
Shaunk
I am attempting to assign the recordset returned from the Getrows method directly to an array as per the following code.
Code:
Dim arrPassword()
strSql = "Select count(*),Keycode FROM tblPassword Group by Keycode"
arrPassword = CurrentProject.Connection.Execute(strSql, intRecordCount, adCmdText).GetRows
ReDim Preserve arrPassword(UBound(arrPassword, 1), UBound(arrPassword, 2))
...then process based on output
This avoids having to explicitly declare a recordset object and clean it up etc.
This works successfully if there are records returned,however, if there are no records to be returned, it fails with "Either BOF or EOF is true or the current record has been deleted".
It fails on the Execute command without giving giving the opportunity to test the contents of the array.
Is there a way to do this, or do I have t go through the whole recordset declaration etc.
Thanks
The risk with keeping an open mind is having your brains fall out.
Shaunk