Re: invalid class typecast



> li := qry2.FieldByName('REFNO') as TLargeIntField; //EXCEPTIO is here

var
str: string;

str := qry.FieldByname('REFNO').ClassName;

You will see what is this field.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"yc" <yc@xxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
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: client side add to a table
    ... 'Write to SQL Server. ... > "Ken Dopierala Jr." ... >> Hi Mark, ... >> var tblMyTable = document.getElementById; ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Removing deadlock
    ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... > Could MS SQL Server be setup to have no deadlock in this code (insert in> transaction from one connection and select from another without closing ... > var conn1 = new ActiveXObject;> var conn2 = new ActiveXObject; ... > cmd.ActiveConnection = conn1; ...
    (microsoft.public.sqlserver.programming)
  • Re: UPDATE and SELECT in one statement
    ... I'm a bit brainwashed by the SQL Server Programming dialect... ... Oracle 9i Personnal Edition. ... var bnd1 NUMBER ... var bnd2 VARCHAR2 ...
    (comp.databases.oracle.server)
  • Re: How to write a set to a database
    ... "John Herbster" Wrote ... if want to store a ... into an Access or SQL server table using your method, ...
    (borland.public.delphi.database.ado)
  • Re: TWebBrowser and SelectAll
    ... MS Jet and Interbase (through OLEDB) ...
    (borland.public.delphi.thirdpartytools.general)