ERLEDIGT
JA
JA
ANTWORTEN
1
1
ZUGRIFFE
1372
1372
EMPFEHLEN
-
Hallo ihr LIeben,
ich habe ein VB-Script, mit dem ich eine Acces-Datenbank komprimiere.
Eigentlich funktionier das auch prima.
Hier mal das Script:
Code :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 28 29 30 31 32 33 34 35 36 37 38 39
Dim objScript Dim objAccess Dim strPathToMDB Dim strMsg ' Get the parameter Set objShell = WScript.CreateObject("WScript.Shell") Set arg = WScript.arguments ' Set the complete path strPathToMDB = arg(0) ' Set a name and path for a temporary mdb file strTempDB = "C:\Comp0001.mdb" ' Creat an object Set objAccess = CreateObject("Access.Application") ' Repairs and compacts the Database into the temporary mdb file objAccess.DbEngine.CompactDatabase strPathToMDB, strTempDB If Err.Number > 0 Then ' There was an error. Inform the user and halt execution strMsg = "The following error was encountered while compacting database:" strMsg = strMsg & vbCrLf & vbCrLf & Err.Description Else ' Create File System Object to handle file manipulations Set objScript= CreateObject("Scripting.FileSystemObject") ' Copy the compacted mdb by into the original file name objScript.CopyFile strTempDB, strPathToMDB, True ' Killing the tempfile objScript.DeleteFile strTempDB End If Set objAccess = Nothing Set objScript = Nothing
Mein Problem ist jetzt, das ich damit auch Datenbanken auf Rechnern komprimieren möchte, auf denen Access nicht installiert ist.
Gibt es da Möglichkeiten?
Habe selber leider kaum VB-Script Erfahrungen, hoffe jemand kann mir helfen.
Liebe Grüße
JaD
-
Ok, hat sich erledigt.
Ähnliche Themen
-
Access Datenbank aus C++ Programm komprimieren
Von Beginnerin im Forum C/C++Antworten: 2Letzter Beitrag: 17.10.05, 13:47 -
Access Datenbank bei beenden automatisch komprimieren
Von Thomas Darimont im Forum Office-AnwendungenAntworten: 0Letzter Beitrag: 30.08.04, 22:51 -
Ms Access Datenbank von Konsole komprimieren
Von Thomas Darimont im Forum Office-AnwendungenAntworten: 0Letzter Beitrag: 17.08.04, 10:44 -
Access-DB komprimieren
Von hans_schmid im Forum Relationale DatenbanksystemeAntworten: 3Letzter Beitrag: 06.05.04, 10:32 -
Access Datenbank komprimieren und reparieren
Von LordDeath im Forum .NET ArchivAntworten: 2Letzter Beitrag: 29.03.04, 12:24





Zitieren
Login





