跟踪一下,确认lujin是一个完整的文件名(包括路径、文件名和扩展名)。

解决方案 »

  1.   

    var lujin:string;
    另外请教:
    DBimage.picture.loadfromfile(dataset.fieldbyname('路径').asstring);
    在dbctrlgrid中只能显示和翻滚表中第一个路径的图片,余下近千条记录的路径的图片就显示不出来,我该怎么做?
    以下为小弟的组合查询代码:procedure Tfrmdemo.ComboBox1Change(Sender: TObject);
    var sesql:string;
        lxid,tpid,ysid,qyid,lbid,ccid:string;//类型,图片,颜色,区域,类寸id
    begin
    sesql:='select c.图片路径 from 礼服名称 b,礼服图片表 c where (b.礼服id=c.礼服id) ';
    if combobox1.text<>'礼服类型' then
       sesql:=sesql+' and (b.礼服类型='''+combobox1.text+''')';
    if combobox2.text<>'礼服区域' then
       sesql:=sesql+' and (b.礼服区域='''+combobox2.text+''')';if combobox3.Text<>'礼服颜色'  then
       sesql:=sesql+' and (b.礼服颜色='''+combobox3.text+''')';
    if combobox4.text<>'礼服类别' then
       sesql:=sesql+' and (b.礼服类别='''+combobox4.text+''')';
    if combobox5.text<>'礼服尺寸' then
       sesql:=sesql+' and (b.礼服尺寸='''+combobox5.text+''')';lfcolor.close;
    lfcolor.sql.clear;
    lfcolor.sql.text:=sesql;
    lfcolor.open;
    dbimage1.Picture.LoadFromFile( lfcolor.fieldbyname('图片路径').asstring);
    end;
    当有很多图片时DBimage只显示第一条记录的路径的图片,其它的就没了?
      

  2.   

    要控制Query呀
    while not lfcolor.eof do
    begin
      //做点工作,比如说取出路径信息;
      lfcolor.next;
    end;
      

  3.   

    while not lfcolor.eof do
    begin
    dbimage1.Picture.LoadFromFile(lfcolor.fieldbyname('图片路径').asstring);
    lfcolor.next;
    end;运行到第二条记录时就出现刚才的错误
    只要运行到第二条记录则路径:'e:\sangna2000xp\图片123.bmp'#$F#$10这种格式就会出错,第一条是:'e:\sangna2002xp\图片122.bmp'是对的
    unknown picture file extension (.bmp)
    另外在表中的 '图片路径'  字段我是直接把图片的路径考到字段里面的,不会有问题吧?
      

  4.   

    image2.Picture:=nil;
    这句什么意思?