Re: Compressing a .mdw file

anonymous_at_discussions.microsoft.com
Date: 08/10/04


Date: Tue, 10 Aug 2004 00:04:44 -0700

Jens

I am using the DAO equivalent of your code. However the
VBA command DBEngine.CompactDatabase will not produce a
usable copy.

Further investigation has revealed that an error table
MSysCompactError is produced which contains the following
record

-1507, Could not find field 'OLDSID'., , MSysAccounts

When I look at table MSysAccounts in the original .mdw,
the OLDSID column is present, but blank. It is not present
on the compacted table.

RH

>-----Original Message-----
>
>"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=Yourpas
sword;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)