Re: Compressing a .mdw file

From: Jens Burup (jens.burup_at_mail.dk)
Date: 08/07/04


Date: Sat, 7 Aug 2004 16:36:55 +0200


"Roger Hampson" <anonymous@discussions.microsoft.com> skrev i en meddelelse
news:123f01c47b87$fdf8a9f0$a501280a@phx.gbl...
> We have a .mdw file that has grown to 61MB. It is use from
> 06:00 to 20:00 every day by a large number of people. If
> we copy it and compress it using Tools | Database
> Utilities | Compress and Repair Database..., it creates a
> perfectly usable .mdw file of 520K. However, we cannot
> replace the old one until everyone has finished using it,
> which is not practical as it needs doing every day. It
> grows to over 3MB in a day.
>
> We decided to compress it by writing a program and using
>
> DBEngine.CompactDatabase SrcName:=DBName,
> DstName:=NewDBName
>
> then renaming the original to x.old and renaming the new
> one to x.mdw.
>
> When we try to use the new .mdw, we get the message "Not a
> valid account name or password."
>
> Any suggestions?
>
> RH

I use this small snippet of code from an vb.net application to compact my
database
Maybe this give you an idea to solve your problem.

Dim jro As JRO.JetEngine

jro = New JRO.JetEngine

Dim OldName, NewName As String

        OldName = Yourpath & "Mydatabse.mdb"

        NewName = Yourpath & "MyTMPdatabse.mdb"

        Try

Rename("Your path\Mydatabse.mdb","your path\MyTMPdatabase.mdb")

jro.CompactDatabase("Provider=Microsoft.Jet.OLEDB.4.0;Password=Yourpassword;
User ID=Your ID;Data Source= " & Yourpath & "MyTMPdatabse.mdb ; ;Jet
OLEDB:System database=" & Yourpath & "YourWorkgroupFile.MDW;Jet
OLEDB:Database Password=Yourpassword;", _

        "Provider=Microsoft.Jet.OLEDB.4.0;Password=Yourpassword;User ID=Your
ID;Data Source= " & Yourpath & "Mydatabse.mdb;Jet OLEDB:System database=" &
Yourpath & " YourWorkgroupFile.MDW;Jet OLEDB:Database
Password=Yourpassword;")

Kill(Yourpath & " MyTMPdatabse.mdb")

Regards
Jens Burup



Relevant Pages

  • Re: Compressing a .mdw file
    ... >> we copy it and compress it using Tools | Database ... >> We decided to compress it by writing a program and using ... >> then renaming the original to x.old and renaming the new ... >Dim jro As JRO.JetEngine ...
    (microsoft.public.access.security)
  • Re: KirbyBase
    ... I'm an Object Guy and Jamey is a Database Guy. ... That requires the table name and key field name to be specified ... I suppose it would in effect be embedding an array where all the ... that is) might compress by a factor of 10 or more. ...
    (comp.lang.ruby)
  • Re: MDB will no longer accept reuslts
    ... If the compress occurs whenever *anything* closes the database, ... Microsoft FrontPage MVP ...
    (microsoft.public.frontpage.client)
  • Re: Compressing Files
    ... >From Acc97 you can set an option to compress the database on close. ... Access 2003 offers a file option to backup a database. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Script in GUI (Was: openSUSE as a router, how to? Solved!)
    ... test if there is nothing busy with using the database, ... I understand the rpm bit. ... It's not the renaming that does it. ... The partition in question is ext3. ...
    (alt.os.linux.suse)