資料庫中編輯2進位檔呢?? |
尚未結案
|
jch
中階會員 ![]() ![]() ![]() 發表:111 回覆:224 積分:66 註冊:2003-12-01 發送簡訊給我 |
//開啟資料庫資料
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 發送簡訊給我 |
|
enta
一般會員 ![]() ![]() 發表:34 回覆:43 積分:15 註冊:2003-09-29 發送簡訊給我 |
|
jch
中階會員 ![]() ![]() ![]() 發表:111 回覆:224 積分:66 註冊:2003-12-01 發送簡訊給我 |
|
hagar
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
參考: 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 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |