473,396 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with this error. I will show you my code

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\topek avow\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\ho usephotos\" & 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
%>


Jul 19 '05 #1
2 2903
On which line?

If:
filename=left(filename,length)
Is length defined and an integer > -1?

If:
finisheddbfile=left(cutdownfile,dbcount-4)
Is dbcount defined and an integer >= 4?

Ray at work
"Ron" <r_******@wastequipaccurate.com> wrote in message
news:uh*************@TK2MSFTNGP11.phx.gbl...
Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'left'

<%
set objFSO = CreateObject("Scripting.FileSystemObject")
'this is the folder you want to check

Jul 19 '05 #2

length has been defined as the length of "Topeka" thus 6
are ALL filenames longer than 6 characters?

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uf*************@tk2msftngp13.phx.gbl...
On which line?

If:
filename=left(filename,length)
Is length defined and an integer > -1?

If:
finisheddbfile=left(cutdownfile,dbcount-4)
Is dbcount defined and an integer >= 4?

Ray at work
"Ron" <r_******@wastequipaccurate.com> wrote in message
news:uh*************@TK2MSFTNGP11.phx.gbl...
Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument: 'left'

<%
set objFSO = CreateObject("Scripting.FileSystemObject")
'this is the folder you want to check


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
7
by: Stephen | last post by:
I have some code which I call from a custom validator however I seem to have got the logic wrong and im having trouble figuring out how to write my code to get things to work the way I require....
1
by: Alpha | last post by:
I have a Window based application that shows up still running in the task manager when I close it. It reaches the "this.close" statement and then it stops at the "}" at the section of the...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
3
by: Matthew Warren | last post by:
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
9
by: Ringo | last post by:
the LeafProject http://www.leafproject.org has a DLL for Face recognition. it is written in C++ but they interface to it from Lisp. I want to interface to it from C#. Their Lisp definitions looks...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.