Autor Beitrag
manfred07
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Di 18.10.05 19:20 
Hallo Delphi-Forum,

habe da ein Problem was ich nicht nachvollziehen kann.
Habe mir eine kleine DVD Datenbank erstellt. Ich habe
da die möglichkeit das ich die Tabelle sortieren kann
nach Nr, Titel und Kategorie. Habe mir zusätzlich noch
mit eingebaut das ich die Datenbank in ein anderes
Verzeichnis kopiere als sicherheit. Wenn ich jetzt
aber die Daten zurück schreibe oder auch in dem Verzeichnis
wo sie als sicherheit liegen, verliert die Datenbank die
IndexNamen.
Wie kann das angehen?
Hier mal der code den ich benutze zum kopieren.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
pfad,dir,name:string;

begin

Dir := '\DVD-Liste';
ForceDirectories(Dir);
name:='DVD.DB';
pfad :='\DVD-Liste\';
CopyFile('DVD.DB', PChar(pfad + name), false); 

end;



Ich hoffe mir kann einer Helfen.
Danke im Voraus

Gruß Manfred

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 19.10.05 07:00 
Was benutzt du denn als Datencontainer und was für den Zugriff?
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Mi 19.10.05 07:33 
Hi digi_c,

ich benutze DataSource dazu und mit einen Button den Befehl
Table1.IndexName:='Nr';

Gruß Manfred
Lake
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78


D6 prof., Delphi 10.2 Tokyo
BeitragVerfasst: Mi 19.10.05 07:40 
Laut Code wird der Index nicht mit kopiert.
ausblenden Delphi-Quelltext
1:
CopyFile('DVD.DB', PChar(pfad + name), false);					
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Mi 19.10.05 08:36 
Hi Lake,

das ist ja auch nur ein Code-Schnipsel.
Kopiert wird noch .XG0 .YG0 .PX , aber ich
habe den Fehler glaube ich gefunden. Im Verzeichnis
liegen noch .XG1 .XG2 .YG1 .YG2 . Meines Wissens
brauch man nur die mit der höheren Zahl.

Gibt es da eine möglichkeit das man es vorher ermitteln
kann welche Datei ich kopieren muß...will ja nicht
immer ins Verzeichnis gucken welche ich kopieren muß.

Danke im voraus

Gruß Manfred
Lake
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 78


D6 prof., Delphi 10.2 Tokyo
BeitragVerfasst: Mi 19.10.05 13:53 
user profile iconmanfred07 hat folgendes geschrieben:
...
liegen noch .XG1 .XG2 .YG1 .YG2 . Meines Wissens
brauch man nur die mit der höheren Zahl.
...

Dies sind die in der Reihenfolge nach angelegten Sekundär-Indexe.
In Deinem Fall existieren noch zwei Sekundärindexe, die nicht gelöscht werden dürfen.

Ist die Zieldatenbank beim Kopieren geschlossen?
manfred07 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 56



BeitragVerfasst: Mi 19.10.05 17:32 
Hi Lake,

da hast du recht!
Ich kopiere jetzt alle Dateien XG0 -2 und YG0 -2 .
Hatte nicht gewusst das die Dateien für den Index sind.

Klappt jetzt alles, Danke!

Gruß Manfred