找回密码
 注册
Simdroid-非首页
查看: 392|回复: 1

[2. C/C++/C#] 【求助】VC6.0技术内幕求助

[复制链接]
lxwjx 该用户已被删除
发表于 2003-9-4 12:35:51 | 显示全部楼层 |阅读模式 来自 上海交通大学
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2003-9-6 21:07:33 | 显示全部楼层 来自 武汉大学

回复: 【求助】VC6.0技术内幕求助

Simdroid开发平台
给你一个帮助文档看看,是否有帮助?
Attempts to repair a corrupted Microsoft Jet database (Microsoft Jet databases only).
  
Syntax
  
DBEngine.RepairDatabase dbname
  
The dbname argument is a String that is the path and file name for an existing Microsoft Jet database file. If you omit the path, only the current directory is searched. If your system supports the uniform naming convention (UNC), you can also specify a network path, such as "\\server1\share1\dir1\db1.mdb".
  
Remarks
  
You must close the database specified by dbname before you repair it. In a multiuser environment, other users can't have dbname open while you're repairing it. If dbname isn't closed or isn't available for exclusive use, an error occurs.
  
This method attempts to repair a database that was marked as possibly corrupt by an incomplete write operation. This can occur if an application using the Microsoft Jet database engine is closed unexpectedly because of a power outage or computer hardware problem. The database won't be marked as possibly corrupt if you use the Close method or if you quit your application in a usual way.
  
The RepairDatabase method also attempts to validate all system tables and all indexes. Any data that can't be repaired is discarded. If the database can't be repaired, a run-time error occurs.
  
When you attempt to open or compact a corrupted database, a run-time error usually occurs. In some situations, however, a corrupted database may not be detected, and no error occurs. It's a good idea to provide your users with a way to use the RepairDatabase method in your application if their database behaves unpredictably.
  
Some types of databases can become corrupted if a user ends an application without closing Database or Recordset objects and the Microsoft Jet database engine; Microsoft Windows doesn't have a chance to write data caches to disk. To avoid corrupt databases, establish procedures for closing applications and shutting down systems that ensure that all cached pages are saved to the database. In some cases, power supplies that can't be interrupted may be necessary to prevent accidental data loss during power fluctuations.
  
Note   After repairing a database, it's also a good idea to compact it using the CompactDatabase method to defragment the file and to recover disk space.

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2026-1-7 04:07 , Processed in 0.030723 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表