Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi FindComponent klappt nicht mit TQuery (https://www.delphipraxis.net/107051-findcomponent-klappt-nicht-mit-tquery.html)

HolgerCW 21. Jan 2008 14:08


FindComponent klappt nicht mit TQuery
 
Hallo zusammen,

folgendes klappt nicht. Da kommt eine Zugriffsverletzung. Warum ?

Delphi-Quellcode:
var
 Query1: TQuery;
 testing: String;
begin
Query1 := TQuery(FindComponent('DM_Query_InfoBox.QueryStadt'));
testing := Query1['BEMERKUNG'];
end;
In der Zeile mit der Variable testing kommt der Fehler ...

Gruss

Holger

DeddyH 21. Jan 2008 14:13

Re: FindComponent klappt nicht mit TQuery
 
Delphi-Quellcode:
var
Query1: TQuery;
testing: String;
begin
  Query1 := TQuery(DM_Query_InfoBox.FindComponent('QueryStadt'));
  if Assigned(Query1) then
    testing := Query1['BEMERKUNG'];
end;
Getippt und nicht getestet.

HolgerCW 21. Jan 2008 14:16

Re: FindComponent klappt nicht mit TQuery
 
Super,

das klappt.

Danke

Holger


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:14 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz