Did you try using Server.MapPath(myname)? The string result should be
the same as what you're passing in, but I had something similar a few
years back which was solved by this for some unknown reason.

Might be worth a try.

Dan

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of anthrax911
Sent: 12 May 2005 14:01
To: [email protected]
Subject: [ASP] Retrieve file attributes not working for me

I am trying to retrieve the 'last modified' property of a file on the
IIS server.  I pull the filename from a field in a database and put the
path into a variable.

1)
dim myname
myname = objRSReport("Path")
response.write myname

^-The above response.write looks like this: d:\rb\Reports\test.rpt


2)
This is my code to get the last modified date:

Dim fs,f
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile(myname)
Response.Write(" File created: " & f.DateCreated) set f=nothing set
fs=nothing

^-This returns a 'File Not Found' error.


3)
But if I hardcode the path as follows it works, how come?

Dim fs,f
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("d:\rb\Reports\test.rpt")
Response.Write(" File created: " & f.DateCreated) set f=nothing set
fs=nothing








---------------------------------------------------------------------

 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [email protected]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links



 




---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [email protected]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to