Click to See Complete Forum and Search --> : EOF Problem with GetRows()


CMangano
June 15th, 2001, 06:01 PM
I have an ASP Component that makes a call to a SQL 7 DB using ADO. I want to return the records using GetRows(). I can do this fine. The problem I have is when there are no records. The ASP page is expecting a 2 dimensional array of records. How can I tell my ASP page that there are no records? Here is my VB Code:


public Function MyFunction() as Variant
     '... db connection is opened

     'execute stored procedure
     oRs.Open oCmd

'make sure we have records
If oRs.BOF Or oRs.EOF then
        'can't return it like this. ASP expects array
        ProductFrontDisplay = ""
else
ProductFrontDisplay = oRs.GetRows
End If
End Function




My ASP code looks like:
'...open dll
arrTest = oConn.MyFunction
'...close dll

'need to check for EOF here, not sure how
For i = 0 To UBound(arrTest, 2)
     'use records
Next

Any help would be greatly appreciated. Thanks.

TH1
June 28th, 2001, 06:30 AM
Can you not just use Erase ProductFrontDisplay so that there are no elements in the array