R
Ron
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'left'
<%
set objFSO = CreateObject("Scripting.FileSystemObject")
'this is the folder you want to check change this to point to your folder
Set objFolder =
objFSO.GetFolder("c:\webffiliates\testimages\topekavow\housephotos")
Set colFiles = objFolder.Files
'This lined can be changed in cas other images are put in folder
name="topeka"
'Check Length of name variable
length=len(name)
'connect to the database
%>
<!--#include file="Connections/vowdsn.asp" -->
<%
set rs=server.createobject("adodb.recordset")
For Each objFile in colFiles
'These following lines just strip the filename down so it can compare with
field1 in the database
filename=objfile.name
lengthof=len(objfile.name)
filename=left(filename,length)
cutdownfile=mid(objfile.name,length+1,lengthof-length)
dbcount=len(cutdownfile)
finisheddbfile=left(cutdownfile,dbcount-4)
if name=filename then
response.write "Filename=" & objfile.name & "<br>"
rssql="SELECT * FROM [ListingsResidential-Residential] where field1='" &
finisheddbfile & "';"
rs.open rssql,myconn
'If file and record dont match then file is deleted
if rs.bof and rs.eof then
indata="No - File Deleted"
'filepath="C:\webffiliates\testimages\topekavow\housephotos\" & objfile.name
'objFSO.DeleteFile (filepath)
else
'File is not deleted
indata="Yes"
end if
rs.close
response.write "Exist in database=" & indata & "<br><br>"
else
end if
Next
%>
Invalid procedure call or argument: 'left'
<%
set objFSO = CreateObject("Scripting.FileSystemObject")
'this is the folder you want to check change this to point to your folder
Set objFolder =
objFSO.GetFolder("c:\webffiliates\testimages\topekavow\housephotos")
Set colFiles = objFolder.Files
'This lined can be changed in cas other images are put in folder
name="topeka"
'Check Length of name variable
length=len(name)
'connect to the database
%>
<!--#include file="Connections/vowdsn.asp" -->
<%
set rs=server.createobject("adodb.recordset")
For Each objFile in colFiles
'These following lines just strip the filename down so it can compare with
field1 in the database
filename=objfile.name
lengthof=len(objfile.name)
filename=left(filename,length)
cutdownfile=mid(objfile.name,length+1,lengthof-length)
dbcount=len(cutdownfile)
finisheddbfile=left(cutdownfile,dbcount-4)
if name=filename then
response.write "Filename=" & objfile.name & "<br>"
rssql="SELECT * FROM [ListingsResidential-Residential] where field1='" &
finisheddbfile & "';"
rs.open rssql,myconn
'If file and record dont match then file is deleted
if rs.bof and rs.eof then
indata="No - File Deleted"
'filepath="C:\webffiliates\testimages\topekavow\housephotos\" & objfile.name
'objFSO.DeleteFile (filepath)
else
'File is not deleted
indata="Yes"
end if
rs.close
response.write "Exist in database=" & indata & "<br><br>"
else
end if
Next
%>