| |

VerySource

 Forgot password?
 Register
Search
View: 762|Reply: 3

How does access database lose weight???

[Copy link]

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-9-25 20:00:01
| Show all posts |Read mode
Now it is like this. I used a loop in vb to insert 80,000 records with different numbers into the table named default in the access database. The database has 122mb.

Then I opened the database with access, created a new one, and dragged the default table to the newly created mdb file, and the result was only 8mb...I think it must be the access database that recorded my 80,000 insert operations...

I beg everyone, how to make the database slim???
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-9-25 20:30:01
| Show all posts
Use ACCESS's "Compress and Repair Database" function
Reply

Use magic Report

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-9-27 13:45:01
| Show all posts
Only use the CompactDatabase method to compress the database. Such as:
     DBEngine.CompactDatabase "C:\My Documents\MyDB.mdb", _
     "C:\My Documents\Test.MDB", dbLangGeneral, dbVersion30, _
     ";pwd=MyPassword1"



Which control does this compactdatabase method belong to?
Reply

Use magic Report

4

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-9-27 14:15:01
| Show all posts
I found the easiest way...also for your reference...
'Install Microsoft ActiveX Data Objects 2.X library (X is 1 or more)
'Quote Microsoft Jet and Replication Objects 2.X library
Dim jro As jro.JetEngine
Set jro = New jro.JetEngine
jro.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\test\test.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\test\new.mdb;"
'Jet OLEDB:Engine Type=4

Thank you all!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list