Get file properties from remote server

G

Guest

ive been playing about with the createobject function but have not been
succussful in trying to acheive what i want.

my customers have an access2003 database with tables in the backend. every
now and then i need to update the table values in the backend. what i need to
check is if the tables that are on my server are newer then the tables stored
in the backend. im using the following code:


Dim oFSO As Object
Dim oF As Object

Set oFSO = CreateObject("Scripting.FileSystemObject", "http://www.easara.com")
Set oF =
oFSO.GetFile("http://www.easara.com/Downloads/Pay...ateRelief/MonthlyDeductStartingRateRelief.xml")

Debug.Print oF.DateCreated
Debug.Print oF.DateLastModified

Set oF = Nothing
Set oFSO = Nothing


im getting an error message "the remote server machine does not exist or is
unavailable" any ideas what im doing wrong. i have no experience with the
createobject function.
 
J

John Nurick

Hi StuJol,

According to Help, the optional servername argument to CreateObject
takes the name of a network server (presumably something like
"\\SERVERNAME" or "SERVERNAME". I don't think there's a suggestion that
it works with an http server - and in any case there's no presumption
that an http server is running Windows or capable of creating OLE
objects.

So I don't think you can do it that way.

If the file you want is in a shared folder on the network, you can just
pass its UNC path to the VBA FileDateTime() function, e.g.

FileDateTime("\\Annemarie\SharedFiles\Temp\60kastruncated.txt")

Otherwise if it's on an http or ftp server, you'll need to use methods
appropriate to those protocols (and beyond my ken).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top