Click to See Complete Forum and Search --> : ADO Recordset as Procedure parameter? (Visual Basic 6)


kiranpchandran
August 23rd, 2001, 11:40 PM
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

vin
August 24th, 2001, 03:11 AM
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

Iouri
August 24th, 2001, 07:19 AM
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
iouri@hotsheet.com