|
-
August 23rd, 2001, 11:40 PM
#1
ADO Recordset as Procedure parameter? (Visual Basic 6)
Hello,
I am a Visual Basic programmer. While working with master-detail forms I need to use SQL Server 2000 Procedure for child recordset to improving the performace. Is there any option for passing a ADO recordset as parameter.
Thanks in advance
Kiran
Aum Namah Shivaya
-
August 24th, 2001, 03:11 AM
#2
Re: ADO Recordset as Procedure parameter? (Visual Basic 6)
Yes there is:
Declare a recordset and call the function
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
Valery Iskarov Nikolov
http://listen.to/quark
-
August 24th, 2001, 07:19 AM
#3
Re: ADO Recordset as Procedure parameter? (Visual Basic 6)
You also can get recordset as returned value of 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]
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
|