![]() |
Datenbank: dBase • Zugriff über: BDE
Couldn't convert varient of type (NULL) into type (String)
Delphi-Quellcode:
Bei diesem Aufruf bekomme ich die im Topic genannte Fehlermeldung.
for count := 1 to Pred(Query2.RecordCount) do begin
hcode:='<tr>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['KLASSEN']+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['S']+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['FUER']+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['WER']+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['FACH']+'</font></td>'+sLineBreak+'<td width=9% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['RAUM']+'</font></td>'+sLineBreak+'<td width=37% bgcolor=#666666><font color=#FFFFFF size=2 face=Arial> '+Query2.FieldValues['BEMER_SCH']+'</font></td>'+sLineBreak+'</tr>'+sLineBreak; WriteLn(Datei, hcode); end; Zudem wird immer für alle Zeile nur der Inhalt der ersten Zeile ausgegeben. Hat da jemand eine Idee? |
Re: Couldn't convert varient of type (NULL) into type (Strin
Ein tabellenfeld hat den Wert NULL was in Delphi in etwa mit Nil vergleichbar ist, also keinen Wert.
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Kann Delphi dann nicht einfach akzeptieren, dass es nichts auszugeben gibt?
Wie kann ich das Problem beheben? |
Re: Couldn't convert varient of type (NULL) into type (Strin
Vor der Ausgabe auf die Null-Werte reagieren (.isNull)
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Moin Svenkan,
Du könntest Dir auch einfach eine Funktion bauen, der Du die Feldwerte übergibst, und die dann, je nach Inhalt einen für Dich verarbeitbaren Wert zurückgibt. |
Re: Couldn't convert varient of type (NULL) into type (Strin
Zitat:
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Ja so ähnlich, dort könntest du auf Null abfragen und ggf 0 oder '' zurückgeben. Bei anderen DBMS kann man das auch direkt in der Abfrage erledigen.
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Zitat:
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Zeig mal deinen geänderten Code
|
Re: Couldn't convert varient of type (NULL) into type (Strin
Delphi-Quellcode:
for count := 1 to Pred(Query2.RecordCount) do begin
Query2.FieldValues['WER'].isNull; Query2.FieldValues['FUER'].isNull; Query2.FieldValues['RAUM'].isNull; Query2.FieldValues['BEMER_SCH'].isNull; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:13 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz