How many ADO recordsets can share a connection ?
If I open an ADO connection to SQL Server as a global variable can multiple
server side ADO recordsets share it simultaneously ??
The recordsets are opened something like this (gcnn is a global object and
a previously opened ADODB connection)
Procedure GetData( StoredProcedureName ) as ADODB,Recordset
dim cmd as ADODB.Command
dim rst as ADODB.Recordset
set cmd = new ADODB.Command
set rst = new ADODB.Recordset
With rst
.CursorLocation = adUseServer
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
' set connection
cmd.ActiveConnection = gcnn
' set command text
cmd.CommandText = StoredProcedureName
'execute command
.Open cmd, , , , adCmdStoredProc
End With
set GetData = rst
End Procedure
Can I then do something like this:
dim rst1 as ADODB.Recordset
dim rst2 as ADODB.Recordset
set rst1 = GetData("up_sel_OrderData")
set rst2 = GetData("up_sel_SalesData")
and use the recorsdets for (2) forms where the user can update the data ??
Or does each recordset need a separate connection ??
cheers
ANDREW
****************************************************************************
andrewbingham.com
tel 01223 514674 (Cambridge)
mobile 07970 161057
fax 07970 601283
DISCLAIMER, PLEASE NOTE:
This communication is for the attention of the named recipient only
The content should not be passed on to any other person.
It is sent in good faith, in confidence, and without legal responsibility.
VIRUS CHECK
Emails and attachments are virus checked using Norton? AntiVirus?
2002 which is regularly updated. However it remains the recipients
responsibility to check emails and attachments sent, or forwarded,
from andrewbingham.com for viruses and macro viruses
****************************************************************************