Autor Beitrag
ElTonno
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

XP, Win 7, Ubuntu
Delphi 2007 Enterprise
BeitragVerfasst: Mo 16.11.09 23:21 
hey leute,

ich möchte in eine table datumswerte reinschreiben was auch funzt und den inhalt dann gleich wieder löschen. hab es mit allem möglichen probiert. SQL, Schleifen und was ich sonst noch so bei Google gefunden habe.
Es geht bei mir irgendwie garnix. Es is voll wichtig, wäre für einen tip sehr sehr dankbar.
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit, Win 10, Win 11
BDS 2006, RAD Studio 2009+C++, Delphi 13, VS 2010 Prof.
BeitragVerfasst: Di 17.11.09 00:01 
Hallo,

welches Datenbanksystem benutzt Du denn?

Bis bald Chemiker
ElTonno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

XP, Win 7, Ubuntu
Delphi 2007 Enterprise
BeitragVerfasst: Di 17.11.09 04:07 
dtable v hab es ja auch schon mit query verucht aber da löscht er mir nur die einträge nich den tablespace also es sind z.b dann noch 10 leere einträge vorhanden kannst du mir helfen??
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit, Win 10, Win 11
BDS 2006, RAD Studio 2009+C++, Delphi 13, VS 2010 Prof.
BeitragVerfasst: Do 19.11.09 23:52 
Hallo ELTonno,

die Informationen die Du zur Verfügung stellst sind einfach nicht ausreichend um Dir einen Lösungsweg aufzuzeigen.

Bis bald Chemiker
ElTonno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

XP, Win 7, Ubuntu
Delphi 2007 Enterprise
BeitragVerfasst: Fr 20.11.09 00:03 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm4.Button1Click(Sender: TObject);
var
  StartDate, EndDate: Cardinal;
begin
 StartDate := Trunc(StrToDate(MaskEdit1.Text));
  EndDate := Trunc(StrToDate(MaskEdit2.Text));
  while StartDate <= EndDate do begin
  Form2.Table2.Append;
  Form2.Table2.FieldByName('Datum').AsString := (DateToStr(StartDate));
  Form2.Table2.Post;
  Inc(StartDate);
  MaskEdit1.Text:='';
  MaskEdit2.Text:='';
end;
Form5.QuickRep1.Preview;
end;


ich schreibe die datumswerte in die table lasse sie durch den QR auf Form 5 anzeigen evtl. ausdrucken und möchte dann den inhalt der table löschen um dann wieder neue datumswerte rein zu schreiben.
was möchtest du noch wissen? beantworte dir was du wissen möchtest. ElTonno


Zuletzt bearbeitet von ElTonno am So 22.11.09 03:08, insgesamt 1-mal bearbeitet
colaka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 200
Erhaltene Danke: 4

Win XP, W7
Delphi 2005 Prof.
BeitragVerfasst: Fr 20.11.09 21:29 
Hallo,

hast Du es denn auch schon mal mit
Form2.table2.EmptyTable
versucht?

Für diesen Befehl mußt Du allerdings die Tabelle im exclusiv-Modus öffnen.

Gruß Ebi
ElTonno Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

XP, Win 7, Ubuntu
Delphi 2007 Enterprise
BeitragVerfasst: So 22.11.09 03:08 
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:
23:
24:
25:
26:
27:
procedure TForm4.Button1Click(Sender: TObject);
var
  StartDate, EndDate: Cardinal;
begin
 StartDate := Trunc(StrToDate(MaskEdit1.Text));
  EndDate := Trunc(StrToDate(MaskEdit2.Text));
  while StartDate <= EndDate do begin
  Form2.Table2.Open; 
  Form2.Table2.Append;
  Form2.Table2.FieldByName('Datum').AsString := (DateToStr(StartDate));
  Form2.Table2.Post;
  Inc(StartDate);
  MaskEdit1.Text:='';
  MaskEdit2.Text:='';
end;
Form5.QuickRep1.Preview; //nachdem die geöffnet worden ist evtl. ausgedruckt wieder zurück zur Form4
end;



procedure TForm4.Tabelleleerenclick(Sender: TObject);
begin
Form2.Table2.Close; // muss sie hier schliessen aber trotzdem noch F.Meldung Tabelle wird von zu vielen nutzern benutzt.
Form2.Table2.Exclusive:=true; //wird hier auf true gesetzt, richtig? oder in delphi von vornherein? 
Form2.Table2.emptytable;
end;
end.

Table in Delphi: active false und Exclusive auch false
was mach ich falsch??? ich verzweifel hier. ne lösung parat bis heute??? wär cool is dringend
JDF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

WinNT, Win2k, WinXP, Win2003
d6ent, d7pro, bds2006ent, vs2003
BeitragVerfasst: Di 24.11.09 10:38 
Hallo!

wenn Du nur temporäre Daten in ein DataSet stellen willst, dann nutze doch einfach ein ClientDataSet und
schreibe die Daten nicht erst in eine Datenbank, wo Du sie nicht richtig löschen kannst.

Gruß Jürgen