473,396 Members | 2,002 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.

Still Can't Delete Files

Thought I would start another thread in case the other had dropped off
people's lists.

Still having problems here when trying to delete files off the server.

Using the code:

Set File = CreateObject("Scripting.FileSystemObject")
ImagePath =
Server.MapPath("..\..\..\sections\ezine\editions\i mages\articlethumbs\")
IssueNum = (RS_Content.Fields.Item("CON_Issue_Number").Value)
Image = (RS_Content.Fields.Item("CON_Image").Value)
ImagePath = ImagePath & "\" & IssueNum & "\" & Image
File.DeleteFile(ImagePath)

Everything I do shows that the recordset contains the correct values, but
the delete still gives me the following error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''
Jul 22 '05 #1
5 1760
"Keith" <@.> wrote ...
Using the code:

Set File = CreateObject("Scripting.FileSystemObject")
ImagePath =
Server.MapPath("..\..\..\sections\ezine\editions\i mages\articlethumbs\")
IssueNum = (RS_Content.Fields.Item("CON_Issue_Number").Value)
Image = (RS_Content.Fields.Item("CON_Image").Value)
ImagePath = ImagePath & "\" & IssueNum & "\" & Image
File.DeleteFile(ImagePath)

Everything I do shows that the recordset contains the correct values, but
the delete still gives me the following error:


I dont remember seeing the other thread, and perhaps its already been
suggested, but what is displayed if you trying:

Response.Write ImagePath prior to File.DeleteFile(ImagePath) etc (dont type
in what you want, paste in what appears etc)

Regards

Rob
Jul 22 '05 #2
"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
news:Td*******************@text.news.blueyonder.co .uk...
"Keith" <@.> wrote ...
Using the code:

Set File = CreateObject("Scripting.FileSystemObject")
ImagePath =
Server.MapPath("..\..\..\sections\ezine\editions\i mages\articlethumbs\")
IssueNum = (RS_Content.Fields.Item("CON_Issue_Number").Value)
Image = (RS_Content.Fields.Item("CON_Image").Value)
ImagePath = ImagePath & "\" & IssueNum & "\" & Image
File.DeleteFile(ImagePath)

Everything I do shows that the recordset contains the correct values, but
the delete still gives me the following error:


I dont remember seeing the other thread, and perhaps its already been
suggested, but what is displayed if you trying:

Response.Write ImagePath prior to File.DeleteFile(ImagePath) etc (dont
type
in what you want, paste in what appears etc)

Regards


It returns what I expected it to - the path to the file on the server
incuding filename and extension.

This is what is so confusing - I KNOW that the values are there - it just
doesn't seem to want to use them.
Jul 22 '05 #3
What if you do something like :
File.DeleteFile "c:\somefile" ?

For now I would though that File is not created correctly...

Does it work ?

Patrice

--

"Keith" <@.> a écrit dans le message de
news:%2****************@TK2MSFTNGP09.phx.gbl...
Thought I would start another thread in case the other had dropped off
people's lists.

Still having problems here when trying to delete files off the server.

Using the code:

Set File = CreateObject("Scripting.FileSystemObject")
ImagePath =
Server.MapPath("..\..\..\sections\ezine\editions\i mages\articlethumbs\")
IssueNum = (RS_Content.Fields.Item("CON_Issue_Number").Value)
Image = (RS_Content.Fields.Item("CON_Image").Value)
ImagePath = ImagePath & "\" & IssueNum & "\" & Image
File.DeleteFile(ImagePath)

Everything I do shows that the recordset contains the correct values, but
the delete still gives me the following error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

Jul 22 '05 #4
I found a way around it.

I set a session variable at the start of the document, use them instead of
referenced to the recordset, and then empty them at the end.

Messy, but works!

I still have no idea why referencing the recordset is not working though.
Jul 22 '05 #5
"Keith" wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
: "Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
: news:Td*******************@text.news.blueyonder.co .uk...
: > "Keith" <@.> wrote ...
: >
: >> Using the code:
: >>
: >> Set File = CreateObject("Scripting.FileSystemObject")
: >> ImagePath =
: >>
Server.MapPath("..\..\..\sections\ezine\editions\i mages\articlethumbs\")
: >> IssueNum = (RS_Content.Fields.Item("CON_Issue_Number").Value)
: >> Image = (RS_Content.Fields.Item("CON_Image").Value)
: >> ImagePath = ImagePath & "\" & IssueNum & "\" & Image
: >> File.DeleteFile(ImagePath)
: >>
: >> Everything I do shows that the recordset contains the correct values,
but
: >> the delete still gives me the following error:
: >
: > I dont remember seeing the other thread, and perhaps its already been
: > suggested, but what is displayed if you trying:
: >
: > Response.Write ImagePath prior to File.DeleteFile(ImagePath) etc (dont
: > type
: > in what you want, paste in what appears etc)
: >
: > Regards
: >
:
: It returns what I expected it to - the path to the file on the server
: incuding filename and extension.

That's great. Can we see it?

: This is what is so confusing - I KNOW that the values are there - it just
: doesn't seem to want to use them.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Jul 22 '05 #6

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

Similar topics

6
by: Neo The One | last post by:
On my development machine, I often delete all folders/files under C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files. That has not caused me any trouble til now. So now we have...
4
by: mike | last post by:
i wonder if bin folder still use in asp.net 2.0 when i migration website for 1.1 how sholud i do? i guess complier would make 2 dll another folder one is bin folder and the other is...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
3
by: richardkreidl | last post by:
I have the following module that I delete old files based on how old they are: Sub Main() Dim First_Date As String = Date.Today.AddDays(-7) Dim Archive_Files() As String =...
9
by: Laurent Bugnion | last post by:
Hi, I am wondering what is the best way to find out which ASP.NET sessions are still active. Here is the reason: I have a custom control which can upload files. It saves the files in a folder...
5
by: CMM | last post by:
I don't seem to "get" ASP.NET 2.0's Localization features. I've read up on everything... and of course, everything is explained in cursory softball terms- not any "real-world" usage way. I hope...
1
by: Ronald S. Cook | last post by:
So the _vti_cnf folder that gets created under my website folders... is this nuisance still around? What happens if I delete the folder.. bad things? Also I see aspnet_client folder here and...
17
by: radhikams | last post by:
Hi I want to create a drag drop tool box using javascript... Can anyone please guide me in this regard Thanks
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.