typecasting objects into recordsets
H3llo
I Have One Function Named
Code:
public Function Executequery(sql As String) As Object
dim Rs As New Adodb.recordset
Set Rs=con.execute(sql) 'con Is A Connection
Executequery
=rs
End Function
The Problem With Me Is The Above Function Doesnot Work
Because I Am Returning A Recordset But My Function Expects An Object. So I Need To Typecast Recordset To Object And Vice Versa.
How Can I Do It? Anyone Plz Can U Help Me?
Re: typecasting objects into recordsets
You are returning an object, zso you will need to assign the return value using the Set command
Code:
public Function Executequery(sql As String) As Object
dim Rs As New Adodb.recordset
Set Rs=con.execute(sql) 'con Is A Connection
Set Executequery = Rs
End Function