Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 12:28 
Hallo,ich habe ein Dynamisches Editfeld und ich möchte den Inhalt in einer Tabelle (*.dbf) hineinschreiben ! Wie mache ich das ???

Dynamischs Editfeld heisst : TE
Tabelle heisst : "Bestell.dbf "

Das Feld in der Tabelle heisst : "ArtNr";

Ich habe geschrieben :

T['ArtNr'] := TE.Text ?

(T = Tabelle)

Aber dann sagt er mir die Meldung : "Ungültige Variant-TypenUmwandlung"

Jagg !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 12:46 
Hi
ausblenden Quelltext
1:
2:
3:
T['ArtNr'].Value := TE.Text;
oder
T['ArtNr'].AsString := TE.Text;


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 19.09.02 13:03 
ausblenden Quelltext
1:
T.Fieldbyname('DeinFeld').AsString := TE.Text;					

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 13:10 
Danke !
Aber jetzt sagt er eine andere Fehlermeldung !

"Datenmenge weder im Editier noch im EInfügemodus!"

Was muss ich jetzt machen ???

Jagg !
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Do 19.09.02 13:16 

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 13:17 
ich habe genommen :

ausblenden Quelltext
1:
T.Fieldbyname('Wieviel').AsString := TE.Text;					


Jagg !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 13:17 
Wo hatte ich nur meinen Kopf? :oops:
Doku schreiben macht doch meschugge. :evil:

Frustgruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 13:24 
hmm......
irgendwie schreibt er nichts in die tabelle rein
hm............

Ich hab das so gemacht wie du gesagt hast wwerner
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 13:31 
Hi
Zitat:

"Datenmenge weder im Editier noch im EInfügemodus!"

Eine der eindeutigsten Fehlermeldungen die Delphi liefert. :mrgreen:
Wenn du was ändern willst:
ausblenden Quelltext
1:
T.Edit;					

Wenns ein neuer Datensatz sein soll:
ausblenden Quelltext
1:
T.Insert					


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 13:41 
Hier ist mein Code :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm11.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_Escape then
    close;
  if Key = VK_F3 then
  begin
    T := TTable.Create(form11);
    T.DatabaseName := 'C:\Nguyen\Info Post Programm\';
      T.Active := False;
      T.TableName := 'Bestell.dbf';
      T.Active := True;
      T.Edit;
      T.Fieldbyname('Wieviel').AsString := TE.Text;
      T.Insert;
    Close;
  end;
end;



Was ist jetzt daran Falsch ???

Jagg !
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Do 19.09.02 13:55 
Hi
auf jeden Fall sollte nach dem Ändern erst mal ein Post kommen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm11.FormKeyDown(Sender: TObject; var Key: Word; 
  Shift: TShiftState); 
begin 
  if Key = VK_Escape then 
    close; 
  if Key = VK_F3 then 
  begin 
    T := TTable.Create(form11); 
    T.DatabaseName := 'C:\Nguyen\Info Post Programm\'; 
      T.Active := False; 
      T.TableName := 'Bestell.dbf'; 
      T.Active := True; 
      T.Edit; 
      T.Fieldbyname('Wieviel').AsString := TE.Text; 
      T.Post; 
    Close; 
  end; 
end;

Aber: Damit würdest du immer nur den ersten Datensatz ändern. Auf dem steht die Tabelle nach dem Öffnen.

Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 15:27 
so wie dein code geht es auch nicht
LCS
MrSpock
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 262



BeitragVerfasst: Do 19.09.02 15:33 
Hallo Jagg,

Edit funktioniert nur, wenn die Datenbank bereits einen Satz enthält, sonst musst du APPEND oder INSERT benutzen, also anstatt:

ausblenden Quelltext
1:
2:
3:
T.Edit;
      T.Fieldbyname('Wieviel').AsString := TE.Text;
      T.Post;


ausblenden Quelltext
1:
2:
3:
T.Append;
      T.Fieldbyname('Wieviel').AsString := TE.Text;
      T.Post;

_________________
Live long and prosper
MrSpock \\//
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Do 19.09.02 15:47 
ich habe das auch schon versucht,aber es geht trotzdem nicht !
Habe Aooend,Post und Insert ausprobiert unter berückdichtigung ob da schon ein satz steht !

Jagg !

Ich schaue mal selber nach jetzt aber ich ihr könnt mir trotzdem weiterhelfen und ideen sind sehr willkommen !!!

;:))))))))))))))))))

Jagg