-
August 12th, 2005, 04:02 AM
#1
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?
-
August 12th, 2005, 05:09 AM
#2
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|