I
Ian Hills
I'm trying to do a purge of uploaded files which are no longer referenced in
a
database table, and I can't see why the line
Set rset = conn.Execute(queryString)
generates a syntax error in IE. The script is below - can you help?
<%
uploadPath = Server.MapPath("../../../uploads")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFldr = objFSO.GetFolder(uploadPath)
Set objFldrContents = objFldr.Files
For each objFileItem in objFldrContents
queryString = "SELECT COUNT AS tot FROM articles WHERE '" &
objFileItem.Name
& "' IN wpfield"
Set conn = Server.CreateObject(ADODB.Connection)
conn.Open "DSN=general"
Set rset = conn.Execute(queryString)
if rset("tot") = 0 then
objFileItem.Delete
endif
Set rset = Nothing
Set conn = Nothing
Next
%>
a
database table, and I can't see why the line
Set rset = conn.Execute(queryString)
generates a syntax error in IE. The script is below - can you help?
<%
uploadPath = Server.MapPath("../../../uploads")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFldr = objFSO.GetFolder(uploadPath)
Set objFldrContents = objFldr.Files
For each objFileItem in objFldrContents
queryString = "SELECT COUNT AS tot FROM articles WHERE '" &
objFileItem.Name
& "' IN wpfield"
Set conn = Server.CreateObject(ADODB.Connection)
conn.Open "DSN=general"
Set rset = conn.Execute(queryString)
if rset("tot") = 0 then
objFileItem.Delete
endif
Set rset = Nothing
Set conn = Nothing
Next
%>