Y
yue_shan
Unregistered / Unconfirmed
GUEST, unregistred user!
1、数据库字段定义为:Image,用存储过程保存、选择一条记录,在中间层上用TStoreProc,TDataSetPrivoder(我本来想在中间层定义一个过程,客户端执行这过程取数据,但不知用什么类型的参数好)
2、客户端用TClientDataSet连接:
保存: with DM.cdsMT_SaveStreamdo
begin
Close;
....
FetchParams;Params[3].LoadFromStream(st,ftGraphic);
.....
Excute;
Close;
end;
取数据:
var
st: TMemoryStream;
FName: string;
begin
Screen.Cursor := crHourGlass;
st := TMemoryStream.Create;
with DM.cdsMT_GetStream
begin
Close;
FetchParams;
Params[0].AsInteger := RecID;
Open;
Tblobfield(FieldByName('Body')).SaveToStream(st);
Close;
end;
FName := ExtractFileDir(Application.ExeName) + 'a.eml'
st.SaveToFile(FName);
st.Free;
end;
大家好空再给参谋,来瞧热闹的也帮提提
2、客户端用TClientDataSet连接:
保存: with DM.cdsMT_SaveStreamdo
begin
Close;
....
FetchParams;Params[3].LoadFromStream(st,ftGraphic);
.....
Excute;
Close;
end;
取数据:
var
st: TMemoryStream;
FName: string;
begin
Screen.Cursor := crHourGlass;
st := TMemoryStream.Create;
with DM.cdsMT_GetStream
begin
Close;
FetchParams;
Params[0].AsInteger := RecID;
Open;
Tblobfield(FieldByName('Body')).SaveToStream(st);
Close;
end;
FName := ExtractFileDir(Application.ExeName) + 'a.eml'
st.SaveToFile(FName);
st.Free;
end;
大家好空再给参谋,来瞧热闹的也帮提提