Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: result sets passed


Message #1 by "Morgan, Rob" <Rob.Morgan@o...> on Tue, 28 Aug 2001 06:55:26 -0400
Can a com object (written in VB) pass a result set to an asp page? 

Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 28 Aug 2001 12:47:24 +0100
yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 

Message #3 by "Bailey, Mark" <MBailey@m...> on Tue, 28 Aug 2001 07:54:29 -0400

Make sure that ADO is installed on the client (Web Server)

also.



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, August 28, 2001 7:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 



Message #4 by "Morgan, Rob" <Rob.Morgan@o...> on Tue, 28 Aug 2001 07:52:46 -0400
Thanks!

Why do you think it might be better as an array, Performance?



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, August 28, 2001 7:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 

Message #5 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 28 Aug 2001 13:12:31 +0100
yes, but its just a hunch



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 12:53

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





Thanks!

Why do you think it might be better as an array, Performance?



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, August 28, 2001 7:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 
Message #6 by "Morgan, Rob" <Rob.Morgan@o...> on Tue, 28 Aug 2001 08:28:12 -0400
Yeah, it's all running on the web server, thanks.



-----Original Message-----

From: Bailey, Mark [mailto:MBailey@m...]

Sent: Tuesday, August 28, 2001 7:54 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed







Make sure that ADO is installed on the client (Web Server)

also.



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, August 28, 2001 7:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 

Message #7 by Rita Greenberg <rg1@h...> on Tue, 28 Aug 2001 07:13:13 -0700
Yesterday I just wrote a DAL in VB 6.0 for an ASP project. I originally

declared the function to return the recordset as ADODB.Recordset. However, I

wanted to know if there was an error (e.g. connection error) so declared the

function as Boolean. I set the function to True if I was able to get my

recordset and set it to False if there was an error returning the record

set. If there were no records returned because there were no records, the

function returned True but the rs.EOF was also True.



I used a parameter in the function as a variant to pass back the recordset.



Here's my ASP code:

Dim datStore

Dim rs						'Set to returned recordset

from DAL

Dim oRS						'Returned from DAL

Dim sStoredProcedureName

Dim bOK



'*** Expose the DAL

Set datStore = Server.CreateObject("WebPPODAL.DataAccessLayer")



'*** Return a list of Transactions from the Database

sStoredProcedureName = "sTRANSACTIONSelectByDataSourceNameForDisplay"

bOK = datStore.GetRecordSet(sStoredProcedureName, sDataSourceName,

sConnection, oRS)

Set rs = oRS

		

Set datStore = Nothing

			

'*** Handle any DAL errors, the exact error is written to ErrorLog.txt in

the DAL

If Not bOK Then

..

Else

..

End If



Here's the VB function declaration code:



'***************************************************************************

*****************

'*** Public Function GetRecordSet

'***    Returns a disconnected recordset.

'***    Argument1: Stored Procedure name to execute

'***    Argument2: PPO Organization

'***    Argument3: Connection to database string

'***    Argument4: Returned Recordset

'***************************************************************************

*****************

Public Function GetRecordSet _

    (ByVal sStoredProcedureName As String, ByVal sDataSourceName As String,

_

     ByVal sConnection As String, ByRef oRS As Variant) As Boolean





-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, August 28, 2001 4:47 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





yes, just declare your function as



Public Function somefunc() as ADODB.Recordset



Although it might be better to return a 2D array instead



-----Original Message-----

From: Morgan, Rob [mailto:Rob.Morgan@o...]

Sent: 28 August 2001 11:55

To: ASP Web HowTo

Subject: [asp_web_howto] result sets passed





Can a com object (written in VB) pass a result set to an asp page? 

Message #8 by "Morgan, Rob" <Rob.Morgan@o...> on Tue, 28 Aug 2001 13:31:31 -0400
Thanks Rita!



-----Original Message-----

From: Rita Greenberg [mailto:rg1@h...]

Sent: Tuesday, August 28, 2001 10:13 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: result sets passed





Yesterday I just wrote a DAL in VB 6.0 for an ASP project. I originally

declared the function to return the recordset as ADODB.Recordset. However, I

wanted to know if there was an error (e.g. connection error) so declared the

function as Boolean. I set the function to True if I was able to get my

recordset and set it to False if there was an error returning the record

set. If there were no records returned because there were no records, the

function returned True but the rs.EOF was also True.



I used a parameter in the function as a variant to pass back the recordset.



Here's my ASP code:

Dim datStore

Dim rs      'Set to returned recordset

from DAL

Dim oRS      'Returned from DAL

Dim sStoredProcedureName

Dim bOK



'*** Expose the DAL

Set datStore = Server.CreateObject("WebPPODAL.DataAccessLayer")



'*** Return a list of Transactions from the Database

sStoredProcedureName = "sTRANSACTIONSelectByDataSourceNameForDisplay"

bOK = datStore.GetRecordSet(sStoredProcedureName, sDataSourceName,

sConnection, oRS)

Set rs = oRS

  

Set datStore = Nothing

   

'*** Handle any DAL errors, the exact error is written to ErrorLog.txt in

the DAL

If Not bOK Then

..

Else

..

End If



Here's the VB function declaration code:



'***************************************************************************

*****************

'*** Public Function GetRecordSet

'***    Returns a disconnected recordset.

'***    Argument1: Stored Procedure name to execute

'***    Argument2: PPO Organization

'***    Argument3: Connection to database string

'***    Argument4: Returned Recordset

'***************************************************************************

*****************

Public Function GetRecordSet _

    (ByVal sStoredProcedureName As String, ByVal sDataSourceName As String,

_

     ByVal sConnection As String, ByRef oRS As Variant) As Boolean




  Return to Index