和Ares的對話 關於更新當前記錄

2022-04-01 13:43:43 字數 3347 閱讀 8279

temperature010203

ares 15:02:10

check(dscursor.modifyrecord(activebuffer));

mofen 14:58:06

就這樣ok了?

mofen 14:58:25

謝謝了mofen 14:58:32

我試一下。:)

ares 15:02:54

function tacbsclientdataset.loadblobdata(fieldname: string): boolean;

varf1, f2 : tfield;

v : variant;

stream, stream1 : tstream;

begin

result := false;

f1 := findfield(fieldname);

if not f1.isnull then

exit;

f2 := findfield(copy(fieldname, 1, length(fieldname) - 4));

if (f1 <> nil) and (f2 <> nil) and (f2 is tnumericfield) and (f2.asinteger > 0) then

begin

check(dsbase.setprop(dsproplogchanges, integer(false)));

tryv := service.getblobdata(f2.asinteger);

if not varisnull(v) then

begin

updatecursorpos;

stream := tacbsutils.varianttostream(v);

stream1 := self.createblobstream(f1, bmread);

trystream.position := 0;

tacbsclientblobstream(stream1).truncate;

stream1.copyfrom(stream, stream.size);

result := true;

finally

stream.free;

stream1.free;

end;

check(dscursor.modifyrecord(activebuffer));

end;

finally

check(dsbase.setprop(dsproplogchanges, integer(true)));

end;

end else

result := false;

end;

ares 15:03:35

要自己寫個控制項,修改activebuffer就好了

mofen 14:59:14

mofen 14:59:21

好mofen 14:59:56

我想做個重新整理當前記錄的方法

ares 15:17:50

那個更簡單啊

mofen 15:13:59

是怎麼做的?

mofen 15:14:12

我打算手動從資料庫裡面重新取過

ares 15:18:51

function refresh(              

newpacket    : psafearray; 

iclientdata  : longword;      

pfreconcile  : pfdsreconcile

): dbresult; stdcall;

mofen 15:15:11

這個是你自己寫的嗎?

ares 15:19:50

dscursor.refreshrecord(vartodatapacket(newdata))

ares 15:19:57

dsintf裡的

ares 15:20:19

function refreshrecord(

packet  : psafearray       

): dbresult; stdcall;

mofen 15:16:22

哦,我這個cds可能不能這樣做

mofen 15:16:41

我的手動賦值data的

ares 15:21:40

我們基本也是手動的

ares 15:21:59

直接用的tclientdataset嗎?

mofen 15:17:51

那你重新整理當前記錄用的是哪個呢?

mofen 15:17:57

不是,繼承了

ares 15:23:34

1:獲取需要重新整理的資料報

2:按tclientdataset的internalfetch方法寫重新整理

mofen 15:20:25

好,3q,我現在去試下。

procedure tcustomclientdataset.internalfetch(options: tfetchoptions);

vardatapacket: tdatapacket;

newdata: olevariant;

baseds: tcustomclientdataset;

begin

if not assigned(dscursor) then checkactive;

updatecursorpos;

check(dscursor.getrowrequestpacket(forecord in options, foblobs in options,

fodetails in options, true, datapacket));

datapackettovariant(datapacket, newdata);

baseds := self;

while assigned(baseds.fparentdataset) do baseds := baseds.fparentdataset;

newdata := baseds.dorowrequest(newdata, byte(options));

updatecursorpos;

check(dscursor.refreshrecord(vartodatapacket(newdata)));

if not active then exit;

dscursor.getcurrentrecord(activebuffer);

if options = [fodetails] then

dataevent(dedatasetchange, 0);

end;

關於物流和電子商務的對話

2004 06 28 08 57 45 逍遙 現在是想看看物流怎麼樣,老兄有什麼建議?你以前應該做過的 2004 06 28 08 57 51 青潤 一定。技術應用在國內的推廣真的有點困難。希望能有機會做下去。2004 06 28 08 58 09 青潤 我以前關注過物流,不過,主要還是側重於電子商...

關於資料的級聯刪除和更新

原文 關於資料的級聯刪除和更新 在這裡我建立兩張表 productcategory product 有乙個需求是這樣的 在刪除某個productcategory 的時候,同時刪除該category的products.這裡是建立兩張表的指令碼 create table dbo productcateg...

和老大的一次對話,關於linux的

小鋒 18 24 43 驅動就是乙個檔案 小鋒 18 25 45 驅動有老的方法和新的方法,老的方法要指定主裝置和裝置號,新的方法就是乙個檔案 小鋒 18 26 59 你看一下devfs 雪之舞 18 24 45 不是,我是說,比如你有乙個硬碟,是fat32的,那應該有乙個硬碟的驅動,還有乙個fat...