BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New To Delphi Question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Usage
View previous topic :: View next topic  
Author Message
Chris Spencer
Guest





PostPosted: Mon Nov 17, 2003 8:21 am    Post subject: New To Delphi Question Reply with quote



I have an imported Active X control that has a property dataSource which is
expecting an ADO resultSet. I can get the resultSet by code as follows:

oADODataSet.RecordSet := oAdoConnection.Execute( sSQL, cmdUnknown
,[eoAsyncExecute]) ;

This is fine however how do I attach that RecordSet to the imported activeX
property?
The next line in code gives a compiler error ;-
Incompatible Types _RecordSet and DataSource.

oResultGrid.DataSource := oADODataSet.RecordSet ;

I am assuming I need to get the Recordset to an OLeVariant or something
similar but I have now hit a brick wall.

Hope the above makes sense.

Any clues?

Thanks
Chris


Back to top
Chris Spencer
Guest





PostPosted: Mon Nov 17, 2003 8:26 am    Post subject: Re: New To Delphi Question Reply with quote



Further info.
The help for the Active X control states:

DataSource is an OLEDB data source such as an ActiveX Data Objects (ADO)
recordset. That is enough to convince me that it should work but being a
beginner???

Chris

"Chris Spencer" <chris (AT) tufware (DOT) com.au> wrote

Quote:
I have an imported Active X control that has a property dataSource which
is
expecting an ADO resultSet. I can get the resultSet by code as follows:

oADODataSet.RecordSet := oAdoConnection.Execute( sSQL,
cmdUnknown
,[eoAsyncExecute]) ;

This is fine however how do I attach that RecordSet to the imported
activeX
property?
The next line in code gives a compiler error ;-
Incompatible Types _RecordSet and DataSource.

oResultGrid.DataSource := oADODataSet.RecordSet ;

I am assuming I need to get the Recordset to an OLeVariant or something
similar but I have now hit a brick wall.

Hope the above makes sense.

Any clues?

Thanks
Chris





Back to top
Chris Spencer
Guest





PostPosted: Mon Nov 17, 2003 9:00 am    Post subject: Re: New To Delphi Question Reply with quote



More Info
On examination of the delphi generated source for the imported Active X the
following was found. Does this mean that the activex is unable to be used in
Delphi?


procedure TitGrid._Set_DataSource(const Param1: DataSource);
{ Warning: The property DataSource has a setter and a getter whose
types do not match. Delphi was unable to generate a property of
this sort and so is using a Variant as a passthrough. }
var
InterfaceVariant: OleVariant;
begin
InterfaceVariant := DefaultInterface;
InterfaceVariant.DataSource := Param1;
end;

Chris


"Chris Spencer" <chris (AT) tufware (DOT) com.au> wrote

Quote:
I have an imported Active X control that has a property dataSource which
is
expecting an ADO resultSet. I can get the resultSet by code as follows:

oADODataSet.RecordSet := oAdoConnection.Execute( sSQL,
cmdUnknown
,[eoAsyncExecute]) ;

This is fine however how do I attach that RecordSet to the imported
activeX
property?
The next line in code gives a compiler error ;-
Incompatible Types _RecordSet and DataSource.

oResultGrid.DataSource := oADODataSet.RecordSet ;

I am assuming I need to get the Recordset to an OLeVariant or something
similar but I have now hit a brick wall.

Hope the above makes sense.

Any clues?

Thanks
Chris





Back to top
Deborah Pate (TeamB)
Guest





PostPosted: Mon Nov 17, 2003 12:35 pm    Post subject: Re: New To Delphi Question Reply with quote

< Does this mean that the activex is unable to be used in
Delphi?
Quote:


No, it doesn't.

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html



Back to top
Chris Spencer
Guest





PostPosted: Mon Nov 17, 2003 7:39 pm    Post subject: Re: New To Delphi Question Reply with quote

Deborah

That is good news but it doesn't answer my original question.
How do I get this to work then?

Chris Spencer
TUFware Systems

"Deborah Pate (TeamB)" <d.pate (AT) blueyonder (DOT) co.not-this-bit.uk> wrote in
message news:VA.00001dbe.0069542c (AT) blueyonder (DOT) co.not-this-bit.uk...
Quote:
Chris Spencer:
Does this mean that the activex is unable to be used in
Delphi?


No, it doesn't.

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html





Back to top
Deborah Pate (TeamB)
Guest





PostPosted: Mon Nov 17, 2003 10:13 pm    Post subject: Re: New To Delphi Question Reply with quote

< That is good news but it doesn't answer my original
question.
Quote:


That's because I don't know the answer to that. :(

What is the DataSource type? The compiler evidently knows
what it is, and it isn't a variant. If you want to try
passing it the recordset as a variant, you could just
assign the recordset to a variant-type variable and pass
that.

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html



Back to top
Chris Spencer
Guest





PostPosted: Tue Nov 18, 2003 7:15 am    Post subject: Re: New To Delphi Question Reply with quote

I modified a few methods to expect an OLEVariant and all is ok now.

Chris Spencer

"Deborah Pate (TeamB)" <d.pate (AT) blueyonder (DOT) co.not-this-bit.uk> wrote in
message news:VA.00001dc7.027cd173 (AT) blueyonder (DOT) co.not-this-bit.uk...
Quote:
Chris Spencer:
That is good news but it doesn't answer my original
question.


That's because I don't know the answer to that. :(

What is the DataSource type? The compiler evidently knows
what it is, and it isn't a variant. If you want to try
passing it the recordset as a variant, you could just
assign the recordset to a variant-type variable and pass
that.

--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi ActiveX Controls Usage All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.