Re: Compressing a .mdw file
From: Jens Burup (jens.burup_at_mail.dk)
Date: 08/07/04
- Next message: JSIMS: "cannot use outlook express"
- Previous message: fjpaterek333_at_sbcglobal.net: "User Security Access"
- In reply to: Roger Hampson: "Compressing a .mdw file"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: Compressing a .mdw file"
- Reply: anonymous_at_discussions.microsoft.com: "Re: Compressing a .mdw file"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: JSIMS: "cannot use outlook express"
- Previous message: fjpaterek333_at_sbcglobal.net: "User Security Access"
- In reply to: Roger Hampson: "Compressing a .mdw file"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: Compressing a .mdw file"
- Reply: anonymous_at_discussions.microsoft.com: "Re: Compressing a .mdw file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|