[DUG] Cant convert varianttypecastError to OleStr

Paul A Norman paul.a.norman at gmail.com
Fri May 19 13:06:12 NZST 2006


Dear Phil,

Just to help me understand, what is the story with the empty member [] ? It
appears to be part of the locate function call, is there a bracket missing?
Is it meant to be an array member?

Otherwise, not sure but I know that there are issues when using VarArrayCreate
Routine (which you are not *directly *doing) with "The element type of the
array, given by the VarType parameter, is a variant type code. This must be
one of the constants defined in the System unit. It cannot include the
varArray or varByRef bits. The element type cannot be varString or a custom
Variant type. To create a variant array of strings use the varOleStr type
code. "


On 19/05/06, Phil Scadden <p.scadden at gns.cri.nz> wrote:
>
> Got a strange one.
>
> This line:
>        ADOTable1.Locate('Alarmtime',VarArrayOf([dt]),[]);
>
> generates 'Could not convert variant of type (Array Variant) into type
> (Olestr).
> (dt is TDateTime)
>
> Any ideas what is going on???
>
>
> ----------------------------------------------------------
> Phil Scadden, Institute of Geological and Nuclear Sciences
> 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand
> Ph +64 3 4799663, fax +64 3 477 5232
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060519/a3f65f25/attachment.html


More information about the Delphi mailing list