CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2001
    Posts
    1

    EOF Problem with GetRows()

    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.


  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: EOF Problem with GetRows()

    Can you not just use Erase ProductFrontDisplay so that there are no elements in the array


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured