Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 3rd, 2004, 09:46 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in Function returning Recordset

Hi!

I have written a DLL function which return a Recordset. I'm unable to handle errors in DLL. And also to unable to catch the

error from ASP page.

Plz, give a solution for this problem
1. How to handle errors in DLL which return a Recordset
2. How to catch this Error from ASP page


Below is the code that i have written.....


Public Function GetReportSummary(Optional ByVal intRegId As Integer, Optional ByVal intAgntId As Double) As ADODB.Recordset

Dim cmdObj As ADODB.Command
Dim cmdRs As ADODB.Recordset

On Error GoTo reportError

 With cmdObj
        .ActiveConnection = DSN
        .CommandText = "sp_REQUEST_QUEUE_T_sel"
        .CommandType = adCmdStoredProc
           ..........
        .........
    Set cmdRs = .Execute
 End With

    Set GetReportSummary = cmdRs

reportError:
    If Err.Number <> 0 Then

    Set GetReportSummary = ??????????????

    How to catch the Errors Here

    End If

End Function

Thanking u in advance for giving the solution

bye
paul

  #2 (permalink)  
Old June 3rd, 2004, 11:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

One option is to not catch the error in the DLL code. The error would then be displayed in the ASP page. Another is to return an error code value byref as one of the parameters to the method. This value would then be known and could be checked in the ASP page.

In the error handler, set:

Set GetReportSummary = ??????????????

to

Set GetReportSummary = Nothing

You could then test for the nothing solution when the recordset was returned.

Hope this helps,

Brian


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning a recordset John Pennington VB Databases Basics 8 August 18th, 2008 08:37 AM
Snapshot recordset returning only 1 record probitaille Access VBA 2 September 6th, 2006 06:16 PM
Function not returning value civa Access 5 January 17th, 2006 03:44 AM
Stored Proceedure Returning A Recordset rodmcleay C# 3 July 5th, 2004 09:53 PM
Function not returning anything... goatboy Beginning PHP 2 December 1st, 2003 12:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.