|
-
October 15th, 2001, 08:33 AM
#1
Recordset as parameters
Thank you for good answers earlier.
Is it possible to a whole recordset as a parameter in VB? I am trying to send a recordset as a parameter when i am starting a new application.. Do someone know how?
K.
-
October 15th, 2001, 08:37 AM
#2
Re: Recordset as parameters
You can create recordset as a function
Private Function myFunc(...any parameters to pass...) As ADODB.Recordset
...process stuff
Set myFunc = rsSomeRecordsetCreated
End Function
call it as:
Dim rs As ADODB.Recordset
Set rs = myFunc(...)
Iouri Boutchkine
[email protected]
-
October 15th, 2001, 08:39 AM
#3
Re: Recordset as parameters
Here is the code how you can send rs as parameter
private Sub Form_Load()
Dim rstTemp as new ADODB.Recordset
rstTemp.CursorLocation = adUseServer
rstTemp.CursorType = adOpenForwardOnly
rstTemp.LockType = adLockReadOnly
UseRecordset(rstTemp)
rstTemp.Close
set rstTemp = nothing
End Sub
public Function UseRecordset(Recordset as Object)
'Check if this is Recordset
If Not TypeOf Recordset is ADODB.Recordset then Exit Function
'Do Sth with Recordset
Recordset.AddNew
'
'
'
Recordset.Update
End Function
Iouri Boutchkine
[email protected]
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
|