ให้ Access2000 Compact File เมื่อเวลาปิดแบบอัตโนมัติ
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 276   4
URL.หัวข้อ / URL
ให้ Access2000 Compact File เมื่อเวลาปิดแบบอัตโนมัติ

คุณสามารถ Compact โปรแกรมที่คุณเขียนเมื่อคุณเลิกใช้โปรแกรมโดยทำขั้นตอนดังนี้ 
Tools.....Options......General......เลือก Check Box compact on close 

4 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R01179
ขอบคุณครับ
2 @R01180
ขอบคุณสำหรับเกล็ดความรู้ดีๆ อย่างนี้ที่นำมาแลกเปลี่ยนกับเพื่อนๆ ครับ มีอะไรดีๆ ก็แนะนำเข้ามาได้อีกนะครับ สิ่งที่ท่านรู้ ยังมีอีกหลายท่านที่ไม่รู้
3 @R01838
เรียน อ.สุภาพ พอดีผมใช้ Access 97 จะ COMPACT โดยใช้ BATCH FILE ได้หรือไม่ คือผมเขียนให้ USER ใช้ประมาณ 5 เครื่องโดยเขียนแยกเป็น 3 โปรแกรม แล้วต้องทำการ BACKUP ข้อมูล ทุกวันเพื่อป้องกัน HDD ที่ SERVER เสีย ตอนนี้ใช้วิธี มาเปิดทีละไฟล์และ COMPACT ทีละไฟล์ แล้วถึงจะไป WRITE ลง CD อีกทีครับ
4 @R01842
จะเขียนเป็น Script หรือ Batch File ก็ได้ครับ จากตัวอย่างของ Access เอง ก็มีโค้ดให้ศึกษาด้วยครับ โดยเข้าไปดูใน Help ด้วยคำค้น CompactDatabase Method จะมีตัวอย่างข้างล่าง Sub CompactDatabaseX() Dim dbsNorthwind As Database Set dbsNorthwind = OpenDatabase("Northwind.mdb") ' Show the properties of the original database. With dbsNorthwind Debug.Print .Name & ", version " & .Version Debug.Print " CollatingOrder = " & .CollatingOrder .Close End With ' Make sure there isn't already a file with the ' name of the compacted database. If Dir("NwindKorean.mdb") <> "" Then _ Kill "NwindKorean.mdb" ' This statement creates a compact version of the ' Northwind database that uses a Korean language ' collating order. DBEngine.CompactDatabase "Northwind.mdb", _ "NwindKorean.mdb", dbLangKorean Set dbsNorthwind = OpenDatabase("NwindKorean.mdb") ' Show the properties of the compacted database. With dbsNorthwind Debug.Print .Name & ", version " & .Version Debug.Print " CollatingOrder = " & .CollatingOrder .Close End With End Sub หรือจะลองอ่านกระทู้เกี่ยวกับเรื่องนี้ที่ http://www.utteraccess.com/forums/showflat.php?Cat=&&Board=access_97&Number=167291&page=&view=&sb=&o=&fpart=all&vc=1 ดูครับ ซึ่งผมได้ไปเอาไฟล์ Script มาไว้ให้ที่นี่แล้วครับ
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.1432s