Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function returns RecordSet
#1
Solved: 11 Years, 3 Months, 4 Weeks ago Exclamation 
Hi All,

Is it possible to return a RecordSet from a function.
Just like return value from function.

I tried this code :
******************************
Code:
Function GetData()
         Set objConnection=fgGetConnection
         strQuery = "SELECT * FROM [DATA$]"
         Set RecordSet = CreateObject("ADODB.recordset")
         RecordSet.Open strQuery, objConnection
        GetData=RecordSet
End Function

The Function call :

Code:
Set RecordSet = CreateObject("ADODB.recordset")
RecordSet = GetData

*****************************
But Im getting an error with Wrong Parameter

Thanks
TestMe
Reply


Messages In This Thread
Function returns RecordSet - by TestMe - 06-19-2009, 03:49 PM
RE: Function returns RecordSet - by QTPian - 06-23-2009, 05:19 PM
RE: Function returns RecordSet - by TestMe - 06-23-2009, 05:57 PM
RE: Function returns RecordSet - by QTPian - 06-24-2009, 02:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GetRows() not fetching the exact record from the recordset Saranyaciet2 0 2,780 05-27-2015, 11:15 AM
Last Post: Saranyaciet2
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,973 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Webtable().GetCellData() Returns hidden values of Cells ssvali 4 5,977 06-07-2013, 08:37 PM
Last Post: kawsar
  QTP - Webtable().GetCellData() returns unknown symbols and spaces lokesh8008 2 4,832 05-10-2013, 03:49 AM
Last Post: sria123
  Creating an array from an specific field in the recordset Arena 0 2,477 04-04-2012, 09:58 PM
Last Post: Arena

Forum Jump:


Users browsing this thread: 1 Guest(s)