?
Solved

Passing Dataset from a Com Object to client

Posted on 2003-03-06
5
Medium Priority
?
201 Views
Last Modified: 2010-04-04
Hi,
 I need to pass a dataset (Tdataset) that I have created in a COM object as  shown below

function TMessageBoard.getCustomerList: OleVariant;
var
  dbconn1 : Tdatabase;
  custData : TStoredProc;
  myxml : conxml ;
  rstr : String;
begin

     custData := omnidm.OmniConn;

    custData :=  TStoredProc.Create(nil)  ;
    custData .DatabaseName := dbconn1 .DatabaseName;
    custData .StoredProcName :=   'sp_getCustomerList';
    custData .Prepare;
    custData .Open;

   
    Result := myproc1;

end;

I get a type mismatch error .

Is it possible to pass Datasets ,if so What should be the return datatype ?

I am using delphi 6.0. currently I am passing data as Variant Arrays .

Regards
Ganesh
0
Comment
Question by:nayakga
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 800 total points
ID: 8086882
you need to pass it to what ?
if to another delphi app then I suggest you use TClientDataSet
the data "is in" Data property as OleVariant :)
so in the COM server you export the data like :

function TMessageBoard.getCustomerList: OleVariant;
begin
   Result := ClientDataSet.Data;
end;


and btw .. what sense does this have :
   custData := omnidm.OmniConn;
   custData := TStoredProc.Create(nil);


a better solution would be to creata a RemoteDataModule
(New > MultiTier > Remote Data Module - DataSnap package must be loaded)
then on the client put a DataSnap connection component (DCOM, Socket, ...) and a ClientDataSet
set the clientdatasets RemoteServer property to the connection component
then select the provider
works nicely :)

for more info check the $Delphi\Demos\Midas\ folder for examples
0
 

Expert Comment

by:Zencovich
ID: 8093592
Try use TADOCOnnection/TADODataSet instead and pass
TADOConnection._Connection and TADODataSet._RecordSet property values.
In host/client application you may set this properties to your own TADODataSet and get access to COM's dataset.

In DCOM configuration you may need set RDSConnection too.

0
 

Expert Comment

by:CleanupPing
ID: 9316903
nayakga:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 10045016
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: Lee_Nover

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question