worship_me
asked on
[ADO] Disconnecting Recordsets executed by Command
How do you disconnect recordsets that were opened this way in ADO...
C++
_CommandPtr pCommand;
pCommand.CreateInstance(-- --);
pCommand->ActiveCommand = pConn;
....
_RecordsetPtr pRset;
pRset.CreateInstance(----) ;
pRset->CursorLocation = adUseClient;
pRset->Open(_variant_t((ID ispatch*)p Command),
vtMissing, adOpenStatic,
adLockBatchOptimistic, adCmdUnspecified);
VB
Dim command AS ADODB.Command
Dim recordset AS ADODB.Recordset
Set command = New ADODB.Command
command.ActiveConnection = conn
...
Set recordset = New ADODB.Recordset
recordset.open command,,adOpenStatic,
adLockBatchOptimistic, adCmdUnspecified
How to set the ActiveConnection property of pRset to NULL or nothing. Do I use the command object that I opened it with?
C++
_CommandPtr pCommand;
pCommand.CreateInstance(--
pCommand->ActiveCommand = pConn;
....
_RecordsetPtr pRset;
pRset.CreateInstance(----)
pRset->CursorLocation = adUseClient;
pRset->Open(_variant_t((ID
vtMissing, adOpenStatic,
adLockBatchOptimistic, adCmdUnspecified);
VB
Dim command AS ADODB.Command
Dim recordset AS ADODB.Recordset
Set command = New ADODB.Command
command.ActiveConnection = conn
...
Set recordset = New ADODB.Recordset
recordset.open command,,adOpenStatic,
adLockBatchOptimistic, adCmdUnspecified
How to set the ActiveConnection property of pRset to NULL or nothing. Do I use the command object that I opened it with?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Points split between emoreau and manduz_griffus
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
ayufans
Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
- Points split between emoreau and manduz_griffus
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
ayufans
Cleanup Volunteer
ASKER
Set recordset = New ADODB.Recordset
recordset.open command,,adOpenStatic,
adLockBatchOptimistic, adCmdUnspecified
recordset.ActiveConnection
somehow this is not possible if recordset is opened with its Source property as a valid Command object.
anyway, thanks.