repair deployed Access database

kantplayalik

Member
Joined
Mar 17, 2006
Messages
7
Programming Experience
1-3
I recently published a forms application in vb 2005 express.

Included in this application is an access database.

The program is behaving as if the database has been corruped, what I'd like to know is....is there a way to open a mdb.deploy file and possible compact and repair it? I looked for a file with the .mdb extension on the clients machine, but it was not there. Does the publishing process reformat the database or something?

Thaks in advance.
 
I don't think there is a native way to do this but you can resort to DAO...

VB.NET:
[COLOR=#000000][FONT=monospace] [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Dim[/FONT][/COLOR][COLOR=#000000][FONT=monospace] db [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]As[/FONT][/COLOR][COLOR=#000000][FONT=monospace] DAO.DBEngine
      [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Dim[/FONT][/COLOR][COLOR=#000000][FONT=monospace] sUFN [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]As[/FONT][/COLOR][COLOR=#000000][FONT=monospace] [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]String
[/FONT][/COLOR][COLOR=#000000][FONT=monospace]      [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Dim[/FONT][/COLOR][COLOR=#000000][FONT=monospace] sFN [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]As[/FONT][/COLOR][COLOR=#000000][FONT=monospace] [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]String[/FONT][/COLOR][COLOR=#000000][FONT=monospace] = _
         System.IO.Path.GetFileNameWithoutExtension(DatabaseName)

      [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Try
[/FONT][/COLOR][COLOR=#000000][FONT=monospace]         sUFN = AppPath & "\" & sFN & Format(Now, "MMddyyyyHHmmss") & _
            ".mdb"
         Rename(DatabaseName, sUFN)
         db = [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]New[/FONT][/COLOR][COLOR=#000000][FONT=monospace] DAO.DBEngine()
         db.CompactDatabase(sUFN, AppPath & "\" & sFN)

      [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Catch[/FONT][/COLOR][COLOR=#000000][FONT=monospace] ex [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]As[/FONT][/COLOR][COLOR=#000000][FONT=monospace] System.Exception
              [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]End[/FONT][/COLOR][COLOR=#000000][FONT=monospace] [/FONT][/COLOR][COLOR=#0000FF][FONT=monospace]Try
[/FONT][/COLOR]


 
Back
Top