You attempted to open a Database that is already opened exclusively by user<n

  • 主题发起人 主题发起人 caojun77
  • 开始时间 开始时间
C

caojun77

Unregistered / Unconfirmed
GUEST, unregistred user!
You attempted to open a Database that is already opened exclusively by user&lt;name&gt; on &lt;machine&gt; name.(100分)<br />I have a question to ask,that is,the Error Number is 3356 and the Error Type is
that You attempted to open a Database that is already opened exclusively by user
&lt;name&gt; on &lt;machine&gt; name.
I am using Delphi 5 and Microsoft Access 97 to develop a database management
system.Then I will tell you the detailed situation of the above-mentioned
queston.
When I directly enter the MIS without any other operation on the database
FangY.mdb,I press the button for the function of Zip,all is OK.However,when I
do some operation,such as input some data or do some query from FangY.mdb before
pressing the Zip buttion,then if I press the Zip button,I will meet the
above-mentioned Error Message.
After some check,I found all is connected with the FangY.ldb.
When FangY.ldb exists,I cannot do the function of zip;when FangY.ldb does not
exist,I can.
Can you tell me how to solve the question using Delphi 5 or Visual Basic 6?
How to close the database or how to delete the FangY.ldb file before pressing
the button for zipping?
 
ZIP函数是干什么用的?
说不定就是它占用了数据库呢。

BTW: 你是外国人吗
 
The FangY.ldb only exist when FangY.mdb is open by either MS ACCESS or by your
program. If you put some operation on the database, you must use a database
component(DaoDatabase or BDE's Database). When this database link to a query,
and the query is open(then you can do something like insert or delete etc),
that is mean FangY.mdb is opend by your program. So, before you put the Zip button
you must close the query, like this: query1.close;
OK!
 
Zip is only a function that I have added to zip the database FangY.mdb.
I am sure Zip has nothing to with the file FangY.ldb.
Because I do some operation,such as input some data or do some query from
FangY.mdb before pressing the Zip button,the FangY.ldb will be created
automatically,then if I press the Zip button,I will meet the
above-mentioned Error Message.
However if don't do any operation on FangY.mdb and directly press the button
of Zip,I can realize the function of zipping the database FangY.mdb.
After some check,I found all is connected with the FangY.ldb.
So my core question is how to remove FangY.ldb or close FangY.mdb before
pressing the button of zip?
(Pay attention to the difference between FangY.mdb and FangY.ldb.)

BTW:I am not a foreigner and I am student from East China Normal University.
Because I am good at English-typing,not Chinese-typing.

 
caojun77:如果你还要继续讨论请定期提前你的帖子,如果不想继续讨论请结束帖子。
 
你的ZIP应该是做PACK 的功能吧,不管怎样它要求独占数据库。
你两项操作的不同是:
1。先输入数据,打开了一个数据库表,然后做ZIP要求独占,因为表已经被打开,所以失败
2。先做ZIP,要求独占当然能成功
解决是:在做ZIP前,先关闭数据库,然后在独占打开操作
 
多人接受答案了。
 
后退
顶部