Autor Beitrag
pepsen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 23.10.06 10:38 
moin moin...
wieso bekomm ich an der im Code kommentierten Stelle diese Fehlermeldung? Was ist da falsch?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
  DateVon:= DateToStr(DateTimeVon.Date);
  DateBis:= DateToStr(DateTimeBis.date);
  with query1 do
    begin
      SQL.Clear;
      SQL.Add('SELECT * FROM Z4MSYS WHERE LNR=(SELECT MAX(LNR) FROM Z4MSYS)');
      open;
      laufnr := FieldByName('LNR').AsString;
      SQL.Clear;
      SQL.add('SELECT * FROM Z4MSYS');
      open;
      RequestLive := true;
      Append;         //FEHLERMELDUNG: EINE DATENMENGE, DIE NUR ZUM LESEN IST, KANN NICHT GEÄNDERT WERDEN!
      FieldByName('LNR').asstring := IntToStr((StrToInt(laufnr) + 1));
      FieldByName('F3').asstring := editFT.Text;
      FieldByName('F1').asstring := DateVon;
      FieldByName('F2').asstring := DateBis;
      FieldByName('F6').AsString := '';
      FieldByName('ART').AsString := 'SO';
      FieldByName('NR').AsString := '0';
      post;
      end;


Zuletzt bearbeitet von pepsen am Mo 23.10.06 10:48, insgesamt 1-mal bearbeitet
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 23.10.06 10:45 
Es scheint sich nicht um einen updatabel view zu handeln. Schau dir mal TupdateSQL an.

_________________
Markus Kinzler.
MisterBum83
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Mo 23.10.06 11:01 
Womöglich sitzt die das ganze nur auf readonly:=true oder du musst die Datenmenge in den EditierModus setzen....
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 23.10.06 11:17 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  DateVon:= DateToStr(DateTimeVon.Date);
  DateBis:= DateToStr(DateTimeBis.date);
  with query1 do
    begin
      laufnr := FieldByName('LNR').AsString;
      close; // NEU !!!
      RequestLive := true; // VERSCHOBEN !!!
      SQL.Clear;
      SQL.add('SELECT * FROM Z4MSYS');
      open;
      Append;         //FEHLERMELDUNG: EINE DATENMENGE, DIE NUR ZUM LESEN IST, KANN NICHT GEÄNDERT WERDEN!

1. Ein RequestLive nach dem Open ist ziemlich sinnlos.
2. Zwar impliziert ein close automatisch ein open, aber das führt nicht zwangsläufig dazu, dass ein davor hingeschriebenes RequestLive := true funktioniert, da die Abfrage noch "offen" ist.
3. Daher muss noch vorher ein Close eigetragen werden.
pepsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 23.10.06 11:26 
ja wunderbar...es funktioniert...vielen Dank!

MfG Pepsen