tik_tak
یک شنبه 07 مهر 1387, 22:22 عصر
جدولم دارای 20 تا فیلد
فیلد بیستم فیلد کلید(F20)-
فیلد 17 به عنوان فیلد ایمیج (F17)
من با این روش رکوردی رو ویرایش میکنم :<<<
procedure TForm1.update(selected_id : integer);
var
Stream:TStream;
begin
with ADOQuery1 do
begin
sql.Text:='select * from picsample';
Open;
end;
stream:=ADOQuery1.CreateBlobStream(ADOQuery1.Field ByName('pic'),bmRead);
image1.Picture.Graphic.SaveToStream(stream);
With ADOQuery1 do
begin
## SQL.Text:='update picsample set F1 = :p0,F2 = :p1,F3 = :p2,F4 = :p3,F5 = :p4,F6 = :p5,F7 = :p6,F8 = :p7,F9 = :p8,F10 = :p9,F11 = :p10,F12 = :p11,F13 = :p12,F14 = :p13,F15 = :p14,F16 = :p15,F17 = :p16,F18 = :p17,F19 = :p18 where F20 = :p19';
Parameters.ParamByName('p0').Value:=edit1.Text;
Parameters.ParamByName('p1').Value:=edit2.Text;
.
.
.
.
.
Parameters.ParamByName('p17').LoadFromStream(strea m,ftBlob);
.
Parameters.ParamByName('p19').Value:=selected_id;
ExecSQL;
end;
end;
ولی برنامه م اجرا نمیشه این خطارو میگیره از خط ##
خطاش اینه :
[Error] Unit1.pas(431): String literals may have at most 255 elements
فیلد بیستم فیلد کلید(F20)-
فیلد 17 به عنوان فیلد ایمیج (F17)
من با این روش رکوردی رو ویرایش میکنم :<<<
procedure TForm1.update(selected_id : integer);
var
Stream:TStream;
begin
with ADOQuery1 do
begin
sql.Text:='select * from picsample';
Open;
end;
stream:=ADOQuery1.CreateBlobStream(ADOQuery1.Field ByName('pic'),bmRead);
image1.Picture.Graphic.SaveToStream(stream);
With ADOQuery1 do
begin
## SQL.Text:='update picsample set F1 = :p0,F2 = :p1,F3 = :p2,F4 = :p3,F5 = :p4,F6 = :p5,F7 = :p6,F8 = :p7,F9 = :p8,F10 = :p9,F11 = :p10,F12 = :p11,F13 = :p12,F14 = :p13,F15 = :p14,F16 = :p15,F17 = :p16,F18 = :p17,F19 = :p18 where F20 = :p19';
Parameters.ParamByName('p0').Value:=edit1.Text;
Parameters.ParamByName('p1').Value:=edit2.Text;
.
.
.
.
.
Parameters.ParamByName('p17').LoadFromStream(strea m,ftBlob);
.
Parameters.ParamByName('p19').Value:=selected_id;
ExecSQL;
end;
end;
ولی برنامه م اجرا نمیشه این خطارو میگیره از خط ##
خطاش اینه :
[Error] Unit1.pas(431): String literals may have at most 255 elements