Autor Beitrag
landwehr
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

WIN XP, WIN 7, WIN 8
Delphi 6, Delphi 2007, Delphi XE2
BeitragVerfasst: Mi 28.07.10 17:23 
Hallo,

ich habe eine unit erstellt zum rücksicheren einer Firebird-Datenbank. Beim umbenennen der Datei auf einem Server bekomme ich immer die Meldung es sind noch weitere user auf die Datenbank angemeldet. Dies stimmt definitiv nicht. Ich habe mich auch von der Datenbank disconnected. Trotzdem läßt Sie sich nicht umbenennen. Was mache ich falsch?

Hier die Code Zeilen

Datebank ist disconnected
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
RNatu_old := '\\' + MandantenQry.FieldByName('Server').AsString + copy(Pfad2Edit.Text, 3,  Length(Pfad2Edit.Text)) +   ProjectConstants.sApplicationShortName + '.iq';

RNatu_neu :=  ProjectConstants.sApplicationShortName + '.iq.old';

if not RenameFile(RNatu_old, RNatu_neu) then
                    ShowMessage('Kann die Datei nicht umbenennen');

Vieleicht hat jemand eine Lösung.

Vielen Dank im voraus.

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt
Moderiert von user profile iconNarses: Topic aus Dateizugriff verschoben am Mi 28.07.2010 um 23:01
Critter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 328
Erhaltene Danke: 3

Windows 7
Delphi 7 Pro.
BeitragVerfasst: Mi 28.07.10 17:44 
Hi,

wie kannst du disconnected sein, wenn du per FieldByName noch auf Tabelleninhalte zugreifst? Machen deine Komponenten vielleicht bei dem Zugriff ein AutoConnect und stellen die Verbindung so wieder her?

critter

_________________
Diejenigen, die grundlegende Freiheiten aufgeben, um ein wenig mehr vorrübergehende Sicherheit zu erkaufen, verdienen weder Freiheit noch Sicherheit.
(Benjamin Franklin;"The Papers of Benjamin Franklin", Vol. 6, Apr. 1, 1755, through Sep. 30, 1756)
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Mi 28.07.10 18:23 
Wenn Du die firebird DB sichern willst, dann nutz lieber den Backup service. Der kann auch gleich saubermachen in dem DB file :)

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
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
D7, BDS 2006, RAD Studio 2009+C++, Delphi XE2, XE3, VS 2010 Prof.
BeitragVerfasst: Mi 28.07.10 21:48 
Hallo landwehr,

vor dem Kopieren sollte der FB-Server gestoppt werden. Anschließend die DB kopieren. Oder besser wie HelgeLange vorgehen und mit BackUp und Restore die DB sichern.

Bis bald Chemiker
landwehr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

WIN XP, WIN 7, WIN 8
Delphi 6, Delphi 2007, Delphi XE2
BeitragVerfasst: Mi 04.08.10 09:49 
Ich benutze Backup und Restore. Das funktioniert auch. Aber anshließend will ich die alte Datenbank umbenennen. Und die neue Datenbank in den Namen der alten Datenbank umbenennen. Leider ist die alte Datenbank aber noch in Benutzung vom wem auch immer. Wie kann ich denn den FB Dienst auf dem Server aus Delphi stoppen und starten.
Gerd Kayser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 632
Erhaltene Danke: 121

Win 7 32-bit
Delphi 2006/XE
BeitragVerfasst: Mi 04.08.10 10:31 
user profile iconlandwehr hat folgendes geschrieben Zum zitierten Posting springen:
Wie kann ich denn den FB Dienst auf dem Server aus Delphi stoppen und starten.
Ich persönlich halte es für keine gute Idee, einfach so einen Service zu stoppen, aber vielleicht hilft Dir das hier weiter: entwickler-forum.de/showthread.php?t=7258
landwehr Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46

WIN XP, WIN 7, WIN 8
Delphi 6, Delphi 2007, Delphi XE2
BeitragVerfasst: Mi 18.08.10 14:10 
Habe das Problem gelöst. War doch noch ein User aktiv.

Danke an alle.

Walter Landwehr