asp读取文件夹所有文件名更新到sql数据库对应字段中
<!--#includefile="**.inc"--><%dimfso,mydir,dname,ccSetFso=server.createobject("Script...
<!--#include file="**.inc" -->
<%
dim fso,mydir,dname,cc
Set Fso=server.createobject("Scripting.FileSystemObject")
set mydir=fso.getfolder(server.mappath("/YLCN/Shop/personPhotos/"))
for each item in mydir.files
dname=item.path
htmfile=replace(dname,mydir&"\","")
cc=left(htmfile,len(htmfile)-4)
sql="select * from btype "'where usercode =&cc
rs.open sql,conn,1,3
rs("picturename")=cc
rs.update
rs.close
Set rs = Nothing
response.write "<a href=""&server.URLEncode(cc)&"" target=_blank>"&cc&"</a><br>"
next
%>
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: 'rs'
/x1.asp, 第 15 行
上面变更为sql="select * from btype where usercode"=&cc
语法错误
/x1.asp, line 14, column 41
sql="select * from btype where usercode"=&cc 展开
<%
dim fso,mydir,dname,cc
Set Fso=server.createobject("Scripting.FileSystemObject")
set mydir=fso.getfolder(server.mappath("/YLCN/Shop/personPhotos/"))
for each item in mydir.files
dname=item.path
htmfile=replace(dname,mydir&"\","")
cc=left(htmfile,len(htmfile)-4)
sql="select * from btype "'where usercode =&cc
rs.open sql,conn,1,3
rs("picturename")=cc
rs.update
rs.close
Set rs = Nothing
response.write "<a href=""&server.URLEncode(cc)&"" target=_blank>"&cc&"</a><br>"
next
%>
Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: 'rs'
/x1.asp, 第 15 行
上面变更为sql="select * from btype where usercode"=&cc
语法错误
/x1.asp, line 14, column 41
sql="select * from btype where usercode"=&cc 展开
展开全部
<!--#include file="**.inc" -->
<%
dim fso,mydir,dname,cc
set rs=server.createobject("adodb.recordset")
Set Fso=server.createobject("Scripting.FileSystemObject")
set mydir=fso.getfolder(server.mappath("/YLCN/Shop/personPhotos/"))
for each item in mydir.files
dname=item.path
htmfile=replace(dname,mydir&"\","")
cc=left(htmfile,len(htmfile)-4)
sql="select * from btype "'where usercode =&cc
rs.open sql,conn,1,3
rs("picturename")=cc
rs.update
rs.close
Set rs = Nothing
response.write "<a href=""&server.URLEncode(cc)&"" target=_blank>"&cc&"</a><br>"
next
%>
<%
dim fso,mydir,dname,cc
set rs=server.createobject("adodb.recordset")
Set Fso=server.createobject("Scripting.FileSystemObject")
set mydir=fso.getfolder(server.mappath("/YLCN/Shop/personPhotos/"))
for each item in mydir.files
dname=item.path
htmfile=replace(dname,mydir&"\","")
cc=left(htmfile,len(htmfile)-4)
sql="select * from btype "'where usercode =&cc
rs.open sql,conn,1,3
rs("picturename")=cc
rs.update
rs.close
Set rs = Nothing
response.write "<a href=""&server.URLEncode(cc)&"" target=_blank>"&cc&"</a><br>"
next
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询