Re: invalid class typecast



Are you sure that your 'REFNO' detected as TLargeIntField in Delphi?

Anyway try the next instead:
Parameters.ParamByName('REFNO').Value := qry2.FieldByName('REFNO').Value;

--
With best regards, Mike Shkolnik
EMail: mshkolnik@xxxxxxxxxxxxx
http://www.scalabium.com

"yc" <yc@xxxxx> wrote in message news:426cc59b$1@xxxxxxxxxxxxxxxxxxxxxxxxx
>
> Hi,
>
> I'am trying to use TLargeIntField, it is giving me a headache.
>
> I've two Access tables tbl1 and tbl2 (qry1 and qry2).
> Using TLargeIntField field type as follows, I get an invalid class
typecast exception.
>
> var
> li : TLargeIntField;
> begin
> with qry1 do
> begin
> Close;
> li := qry2.FieldByName('REFNO') as TLargeIntField; //EXCEPTIO is here
> Parameters.ParamByName('REFNO').Value := li.Value;
> Open;
> end;
> end;
>
> Any idea ?
>
> Thanks in advance
> yc


.



Relevant Pages

  • Re: Progressbar color
    ... Delphi tip#138: change a color of standard TProgressbar ... With best regards, Mike Shkolnik ...
    (alt.comp.lang.borland-delphi)
  • Re: No Version Info?
    ... With best regards, Mike Shkolnik ... > I use Delphi 7/WinXP/640mb ram. ... > though the Option is set in Project options to include such ...
    (borland.public.delphi.nativeapi)
  • Re: Tabbed MDI Component
    ... and implemented using standard docking mechanism ... With best regards, Mike Shkolnik ... > doesn't work with Delphi. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Get return value of VBS Script
    ... >>> You may use our freeware component (wrapper for MS Script Control): ... >>> With best regards, Mike Shkolnik ... >>>> Is there a way to execute a vbs script in a delphi ...
    (alt.comp.lang.borland-delphi)
  • Re: Printing HTML
    ... With best regards, Mike Shkolnik ... "John Bester" wrote in message ... > I use Delphi 6 on Windows 2000. ...
    (comp.lang.pascal.delphi.misc)