我要向access数据库存储图片信息,只是存储这个图片的名称如:图片名为:t
数据库对应的字段为photo,t本没有后缀名,但在存储时用下列语名:
adotable1.fieldbyname('photo').asstring:=extractfilename((openpicturedialog1.filename))时它在库中变为t.bmp
请问有什么方法把它存在库中时也为t,不会变成t.bmp.
数据库对应的字段为photo,t本没有后缀名,但在存储时用下列语名:
adotable1.fieldbyname('photo').asstring:=extractfilename((openpicturedialog1.filename))时它在库中变为t.bmp
请问有什么方法把它存在库中时也为t,不会变成t.bmp.
这样
copy(extractfilename(openpicturedialog1.filename),1,length(extractfilename(openpicturedialog1.filename))-4)
可能不对
你用copy这个函数吧,
fName: String;
begin
fName:=ExtractFileName(openpicturedialog1.filename);
SetLength(fName,Length(fName)-Length(ExtractFileExt(fName)));
//此后fName就没有扩展名了
//...
end;
//适用于所有格式的扩展名,不限于三字符