[求助]读取数据库,动态赋值图片名,是图片显示正确
[这个贴子最后由lushibin在 2006/05/21 09:57am 第 2 次编辑]
ODBCHandle:=ODBCOpen(WindowHandle, "", "HB_DSN", "", garypass)
seekSQL2:="select 编号,图片路径,参数路径 from 产品 where 二级目录=';灯';"
cp:=ODBCExecute(ODBCHandle, seekSQL2)
cpzs:=LineCount(cp)
ODBCClose(ODBCHandle)
Initialize(ODBCHandle)
---===读取数据完毕===========
total:=INT(cpzs/9)-====总页码
if Fraction(cpzs/9)<>"" then
total:=total+1
end if---====判断是否有余数,有则加之
做到这里后,把数据读出来了存在CP字符串中如下:
LF001 123.jpg 123.gif
LF002 aaa.jpg aaa.gif
LF003 bbb.jpg bbb.gif
LF004 ccc.jpg ccc.gif
LF005 ddd.jpg ddd.gif
---=在后面有5个显示图标(pic1,pic2,pic3,pic4,pic5),分别插入图片,路径分别设置为=photopath1,=photopath2,=photopath3
,=photopath4,=photopath5
-===================================
---====开始赋值,解决不了问题了
repeat with n:=1 to 5
photopath^n:=SubStr( getline(cp,n),1, find(tab,getline(cp,n)) )
end repeat
-=====这里photopath^n就出现问题了!
各位大师,帮帮小弟哟!
先谢过!