Board index » delphi » Releasing ADO Command and Parameter objects

Releasing ADO Command and Parameter objects


2003-09-05 09:28:32 PM
delphi158
Hi all
I'm creating a small app in Delphi 5 and ADO 2.6 to connect to M$ Sql.
I don't have ADO Express.
I'm using command objects with parameters to run stored procedures on the
server - which works fine.
When I have done this in Visual Basic in the past, I have always explicitly
released the Command and Parameter objects after execution of the stored
procedure.
But I can not find any method to free or release these objects in my ADODB_TLB
file. I have tried calling the command's destroy method, but this results in
a "Method 'Destroy' not supported by automation object" error.
Anyone know how to release / free these objects ? (or do I need to ?)
Mike
 
 

Re:Releasing ADO Command and Parameter objects

Thanks very much Viatcheslav.
I'll take some time off to study interfaces !
Mike
"Viatcheslav V. Vassiliev" <XXXX@XXXXX.COM>writes
Quote
You work with interfaces, not with objects. Delphi will release interface
automatically when it goes out of scope (on function prolog if interface
is
local variable, when you call Finalize on structure etc). You may manually
release interface pointer by assigning nil.

intf := nil;

This will call Release() method on this interface pointer.

----------------------------------------------------------------
Regards,
Viatcheslav V. Vassiliev
www.oledbdirect.com
The fastest way to access MS SQL Server, MS Jet (MS Access)
and Interbase (through OLEDB) databases.

"Mike Manning" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях
следующе? news:3f588ecc$XXXX@XXXXX.COM...
>Hi all
>I'm creating a small app in Delphi 5 and ADO 2.6 to connect to M$ Sql.
>I don't have ADO Express.
>I'm using command objects with parameters to run stored procedures on
the
>server - which works fine.
>
>When I have done this in Visual Basic in the past, I have always explicitly
>released the Command and Parameter objects after execution of the stored
>procedure.
>But I can not find any method to free or release these objects in my
ADODB_TLB
>file. I have tried calling the command's destroy method, but this results
in
>a "Method 'Destroy' not supported by automation object" error.
>
>Anyone know how to release / free these objects ? (or do I need to ?)
>
>Mike
>
>
>
>
>