Autor Beitrag
galbe19
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Mi 24.10.07 07:56 
hallo

ich habe eine datenbank und ich will sie loschen aber ich kann sie nicht loschen wenn sie benutzt wird.
wie kann ich testen ob sie benutzt wird oder nicht?

mfg
Alex


Moderiert von user profile iconNarses: Topic aus VCL (Visual Component Library) verschoben am Mi 24.10.2007 um 10:50
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 24.10.07 08:12 
Um was für eine Datenbank handelt es sich?

_________________
Markus Kinzler.
galbe19 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Mi 24.10.07 08:30 
es geh um eie TTable

mfg
alex
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 24.10.07 08:39 
TTable ist keine Datenbank sondern eine Komponente zum Datenbankzugriff. Datenbanken sind sowas wie Oracle, MySQL, Paradox etc.

Was willst du löschen?

1. Die TTable-Komponente
2. Einen Datensatz aus der Tabelle
3. Die Tabelle
4. Die Datenbank

_________________
Bravery calls my name in the sound of the wind in the night...
galbe19 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 56



BeitragVerfasst: Mi 24.10.07 08:44 
hallo

das ist meine procedure

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure tform1.leeren;
begin
with table3 do
 begin
 active := false;
 tablename := 'kunden.dbf';
 tabletype := ttDefault;
 emptytable;
 active:=true;
 end;
end;


wenn 2 personen die datenbank benutzten kann ich es nicht leeren.
ich mochte eine abfrage machen und wenn sie nicht benutzt wird dass ich sie so leeren kann

mfg
alex

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Mi 24.10.07 09:57 
Das sieht mir nach DBase, Paradox oder sowas aus, also keinem Datenbanksystem, sondern nur eine Ansammlung von Dateien. Da wüsste ich keine Möglichkeit abzufragen, ob noch wer anders die Tabelle benutzt. Bleibt nur, es in nem Try-Except-Block zu versuchen und bei nem Fehler passend reagieren.

_________________
Bravery calls my name in the sound of the wind in the night...
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Mi 24.10.07 10:01 
user profile icongalbe19 hat folgendes geschrieben:
hallo
ich mochte eine abfrage machen und wenn sie nicht benutzt wird dass ich sie so leeren kann

Eine Tabelle kann nur dann geleert werden, wenn sie im Exclusi-Modus geöffnet ist, also setzen wir selbige in den entsprechenden Modus und fragen ab, ob sie dann geöffnet werden kann:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure tform1.leeren;
begin
with table3 do
 begin
   Active := false;
   Tablename := 'kunden.dbf';
   Tabletype := ttDefault;
   Exclusive := True; 
   try
     EmptyTable;
   except
     ShowMessage('Tabelle wird noch benutzt');
   end;
   Exclusive := false;
   active:=true;
 end;
end;