 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
小寶寶
註冊時間: 2004-08-20 文章: 57
第 1 樓
|
發表於: 星期一 五月 02, 2005 1:27 pm 文章主題: 重建索引-PACK-多人使用系統 |
|
|
小弟使用OPEN DATABASE STOK EXCL
之後開啟每個資料表....來做PACK與REINDEX....
可是我使用USED()函數來判別是否有其他使用開啟...
結果無效....
發現USERD()函數是判斷自己是否開啟...
不知是不是要用其他函數來測試資料表是否被其他使用者開啟呢 ??? |
|
回頂端 |
|
 |
bin1x
註冊時間: 2004-08-27 文章: 462
第 2 樓
|
發表於: 星期一 五月 02, 2005 1:44 pm 文章主題: |
|
|
EXCL 的話,使用ERROR(),吧
CODE 要查一下
至於處理,
看你要不要寫成重覆開啟直到開啟成功
SHARE 狀況
使用FLOCK() 當發生APPEND 時,會發生.T.
我是有寫到RLOCK() |
|
回頂端 |
|
 |
syntech
註冊時間: 2003-05-16 文章: 4249 來自: Taipei,Taiwan
第 3 樓
|
發表於: 星期一 五月 02, 2005 1:58 pm 文章主題: |
|
|
一般應該是用 FLOCK() 或 LOCK,
取得檔案獨占權,
再作 PACK ,或是 REINDEX 的動作.
請詳閱 HELP _________________ 如果公司有下列困擾:
1. 找不到便宜,快速,簡易的 生產排程軟體
2. 不知道如何快速排定 採購計劃
3. 成本抓不準,自己算比軟體算有用
4. 想學習系統規劃,想找系統架構的顧問
請聯絡我們,也許我們幫得上忙 |
|
回頂端 |
|
 |
小桑•無痕

註冊時間: 2003-07-08 文章: 304 來自: Tainan, Taiwan
第 4 樓
|
發表於: 星期一 五月 02, 2005 5:35 pm 文章主題: |
|
|
REINDEX MSDN Example
In the following example, ISEXCLUSIVE( ) verifies that the customer table was opened for exclusive use. The table is not reindexed since the one in the current work area was not opened for exclusive use.
cExclusive = SET('EXCLUSIVE')
SET EXCLUSIVE OFF
SET PATH TO (HOME(2) + 'Data\')
OPEN DATA testdata && Opens the test databsase
USE Customer && Not opened exclusively
USE Employee IN 0 EXCLUSIVE && Opened exclusively in another work area
IF ISEXCLUSIVE( )
REINDEX && Can only be done if table opened exclusively
ELSE
WAIT WINDOW 'The table has to be exclusively opened'
ENDIF
SET EXCLUSIVE &cExclusive _________________ 用力 Try 一下...可以發現很多好玩的事.... |
|
回頂端 |
|
 |
小桑•無痕

註冊時間: 2003-07-08 文章: 304 來自: Tainan, Taiwan
第 5 樓
|
發表於: 星期一 五月 02, 2005 5:39 pm 文章主題: |
|
|
MSDN PACK
Remarks
When you use PACK, Microsoft Visual FoxPro copies all records not marked for deletion to a temporary table. After PACK is finished executing, Visual FoxPro deletes the original table from disk and renames the temporary table with the original table name. If you press ESC to interrupt PACK, the temporary table is deleted, and the original table remains unchanged. The original table is also recovered if you run out of disk space while PACK is executing.
When you issue PACK without the MEMO and DBF clauses, PACK affects both the table and the memo file.
PACK requires exclusive use of the table. For more information about opening a table exclusively on a network, see SET EXCLUSIVE.
所以,FLOCK對PACK和REINDEX是沒有作用的;要執行PACK和REINDEX的方法是以EXCLUSIVE方式開啟檔案。 _________________ 用力 Try 一下...可以發現很多好玩的事.... |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|