begin
if application.MessageBox(Update','FAQ',MB_OKCANCEL)=id_ok then
begin
savepath:=ExtractFilePath(application.ExeName)+'FAQ_NEW.EXE';
FS:=TFileStream.Create(savepath,fmCreate);
dm.Adoconn.BeginTrans;
dm.adoqry_temp.SQL.Text:='select file from product where id in (select max(id) from product)';
dm.Adoqry_temp.Open;
LoadFromImage(dm.Adoqry_temp.FieldByName('file'),FS);
dm.Adoconn.CommitTrans;
FS.Free;
end;
end;
//上面的file是image类型
可是程序运行到open的时候,就提示出错:
在关键字中'file'有语法错误.
if application.MessageBox(Update','FAQ',MB_OKCANCEL)=id_ok then
begin
savepath:=ExtractFilePath(application.ExeName)+'FAQ_NEW.EXE';
FS:=TFileStream.Create(savepath,fmCreate);
dm.Adoconn.BeginTrans;
dm.adoqry_temp.SQL.Text:='select file from product where id in (select max(id) from product)';
dm.Adoqry_temp.Open;
LoadFromImage(dm.Adoqry_temp.FieldByName('file'),FS);
dm.Adoconn.CommitTrans;
FS.Free;
end;
end;
//上面的file是image类型
可是程序运行到open的时候,就提示出错:
在关键字中'file'有语法错误.
请问要怎么写才比较好呢,不够分再加
dm.adoqry_temp.SQL.Text:='select [file] from product where id in (select max(id) from product)'; file是SQL的关健字,文件和文件组备份或还原时用到
用户建表时字段最好不要用这些关健字,要用的时候,查询时加上括号