| View previous topic :: View next topic |
| Author |
Message |
Chris Spencer Guest
|
Posted: Mon Nov 17, 2003 8:21 am Post subject: New To Delphi Question |
|
|
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
|
Posted: Mon Nov 17, 2003 8:26 am Post subject: Re: New To Delphi Question |
|
|
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
|
Posted: Mon Nov 17, 2003 9:00 am Post subject: Re: New To Delphi Question |
|
|
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
|
Posted: Mon Nov 17, 2003 12:35 pm Post subject: Re: New To Delphi Question |
|
|
<
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 |
|
 |
Chris Spencer Guest
|
Posted: Mon Nov 17, 2003 7:39 pm Post subject: Re: New To Delphi Question |
|
|
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...
|
|
| Back to top |
|
 |
Deborah Pate (TeamB) Guest
|
Posted: Mon Nov 17, 2003 10:13 pm Post subject: Re: New To Delphi Question |
|
|
<
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 |
|
 |
Chris Spencer Guest
|
Posted: Tue Nov 18, 2003 7:15 am Post subject: Re: New To Delphi Question |
|
|
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 |
|
 |
|