全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1178
推到 Plurk!
推到 Facebook!

資料庫中編輯2進位檔呢??

尚未結案
jch
中階會員


發表:111
回覆:224
積分:66
註冊:2003-12-01

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-07-02 16:27:50 IP:163.17.xxx.xxx 未訂閱
//開啟資料庫資料 q0 := TQuery.Create(nil); with q0 do begin DatabaseName := mCmp.Data; RequestLive := True; with SQL do begin Clear; Add('select fish from tac_image'); end; Prepare; Open; if Bof and Eof then begin Append; TbLobField(FieldByName('fish')).LoadFromFile('c:\~sal\fish_p.stc'); end else begin Edit; TbLobField(FieldByName('fish')).LoadFromFile('c:\~sal\fish_p.stc'); end; Post; Close; Free; end; 小使用的是D7和SQL2000,其中fish欄位為image型態,如上若資料庫為空值時,則一切證長,但是若有值時,在下Edit指令時就會出現錯誤!!不知是哪裡出了問題??請各位先進幫幫忙!! ======================== 我是DELPHI5的初學者
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-07-02 17:28:38 IP:202.39.xxx.xxx 未訂閱
錯誤訊息是什麼?
enta
一般會員


發表:34
回覆:43
積分:15
註冊:2003-09-29

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-07-02 17:38:27 IP:220.134.xxx.xxx 未訂閱
No,直接在 Richedit 上畫框線及Richedit To Preview,而非在 DbRichedit 上. winxp delphi 5.0 PS.畫框線功能要與 WORD 相似. 感謝回應. chang yung chin 發表人 - enta 於 2004/07/02 17:40:23 發表人 - enta 於 2004/07/02 17:42:03
------
chang yung chin
jch
中階會員


發表:111
回覆:224
積分:66
註冊:2003-12-01

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-07-02 17:54:40 IP:163.17.xxx.xxx 未訂閱
錯誤訊息為"Non-blob column in table required to perfrom operation." 請大哥幫幫忙!! 至於enta兄,這是??????? ======================== 我是DELPHI5的初學者
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-07-02 18:01:19 IP:202.39.xxx.xxx 未訂閱
參考: http://www.delphi32.com/info_facts/faq/faq_825.asp How come I'm getting the error "Non Blob column in table required to perform operation" when posting to my MSSQL database? There are two conditions where this error occurs:    You have an identity field and a field that is NOT NULL (required) and you post a record. With BDE versions prior 5. 0, all you can do is ignore the error and continue. The problem is resolved simply by getting BDE 5. 0.    You have an identity field which is the primary key and a key field, you have a text field, and you post a record. With BDE versions prior 5. 0, all you can do is ignore the error and continue. If you have BDE 5. 0 and Delphi, you can turn on the AutoRefresh property of your DataSet to resolve the problem.    If you have BDE 5. 0 and development system other than Delphi 5, you can call DbiSetProp and set curAUTOREFETCH (which is equal to 0x000500 7) to true.    C++ Builder Example:
#include "bde.hpp"    #define curAUTOREFETCH 0x000500 7;     Table1->Open();
DbiSetProp(Table1->Handle, curAUTOREFETCH, TRUE);
Delphi version other than 5 example:
uses bde;    const
  curAUTOREFETCH = $000500 7;     begin
  //... 
  Table1.Open;
  DbiSetProp(hDbiObj(Table1.Handle), curAUTOREFETCH, Longint(TRUE));
end;
-- Everything I say is a lie.
jch
中階會員


發表:111
回覆:224
積分:66
註冊:2003-12-01

發送簡訊給我
#6 引用回覆 回覆 發表時間:2004-07-05 09:40:43 IP:163.17.xxx.xxx 未訂閱
多謝hagar大哥,原來是TABLE一定要加上KEY才行!!感恩喔! ======================== 我是DELPHI5的初學者
系統時間:2025-02-28 7:13:32
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!