 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
LKH
註冊時間: 2004-09-17 文章: 31 來自: 香港
第 1 樓
|
發表於: 星期二 十月 19, 2004 1:08 am 文章主題: remote update 的問題 |
|
|
handle=getmysqlconnect()
SQLEXEC(handle,"select item_no ,item_name from mitem","mycursor")
CURSORSETPROP('buffering', 3, 'mycursor')
SELECT mycursor
CURSORSETPROP("Tables","mitem","mycursor")
CURSORSETPROP("KeyFieldList","item_no","mycursor")
CURSORSETPROP("UpdatableFieldList" ,"item_no, item_name","mycursor")
replace mycursor.item_name WITH "new item name"
CURSORSETPROP("UpdateNameList"," item_no mitem.item.no, item_name mitem.item_name","mycursor")
CURSORSETPROP("SendUpdates" ,.t.,"mycursor")
我用上列句子, 希望將 view 中的 最新的 item_name --- "new item name" 更新到遠端的資料庫, 但完成後及想關閉 mycursor 時出現下列句子.
No key columns are specified for the updated table "mitem". Use the KeyFieldList property of the cursor.
我在上面的句己用了 cursorsetprop("KeyFieldList","item_no","mycursor") 為甚麼還會出錯
請各高手指教, 謝謝. _________________ 謝謝賜教 |
|
回頂端 |
|
 |
elleryq

註冊時間: 2007-06-21 文章: 768
第 2 樓
|
發表於: 星期二 十月 19, 2004 9:17 am 文章主題: |
|
|
好像是格式錯了吧~~
記得是這樣
"mycursor item_no" |
|
回頂端 |
|
 |
LKH
註冊時間: 2004-09-17 文章: 31 來自: 香港
第 3 樓
|
發表於: 星期二 十月 19, 2004 11:11 am 文章主題: |
|
|
ellergy 兄, 謝謝你的提示, 但試了多次都都能解決.
相信 CURSORSETPROP("KeyFieldList","item_no","mycursor") 這句句子的組句沒有問題. _________________ 謝謝賜教 |
|
回頂端 |
|
 |
garfield Site Admin

註冊時間: 2003-01-30 文章: 2160
第 4 樓
|
發表於: 星期三 十月 20, 2004 2:39 pm 文章主題: |
|
|
CURSORSETPROP("UpdateNameList"," item_no mitem.item.no,....
不知是否是 mitem.item.no 打錯字 mitem.item_no 才對. _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
 |
LKH
註冊時間: 2004-09-17 文章: 31 來自: 香港
第 5 樓
|
發表於: 星期六 十月 23, 2004 1:28 am 文章主題: |
|
|
garfield 兄:
你的眼睛真利, 我真是將mitem.item_no 打錯成 mitem.item.no., 我一直都沒有發覺, 我花了好幾天時間也找不到問題所在, 真是想放棄. 幸而得你提點, 因而解決我的問題.
真是十分感謝! _________________ 謝謝賜教 |
|
回頂端 |
|
 |
elleryq

註冊時間: 2007-06-21 文章: 768
第 6 樓
|
發表於: 星期二 十月 26, 2004 9:40 am 文章主題: |
|
|
這種錯誤真是令人....扼腕~~ |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|