Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delphi com - returning ADO recordsets

Status
Not open for further replies.

MASLK

Programmer
Nov 4, 2001
2
LK
hi!

can anybody tell me how to return a ADO recordset object from a COM made with delphi

any help would be appreciated.

thanks

MAS
 
On the COM server end, you should have a method that takes a return parameter of type
Code:
VARIANT*
, with a
Code:
retval
modifier, so you have something like:

Code:
function TCOMADOObject.getDataSet(out returnRecordSet: OleVariant): HResult;
begin
	...
	returnRecordSet := ADODataSet1.RecordSet;
end;

On the client end, you should do something like this:

Code:
var
	recSet: OleVariant;
begin
	COMObject.getDataSet(recSet);
	ADODataSet1.RecordSet := IUnknown(recSet) as _RecordSet;
 
thanx a million mike appreciate the help :) !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top