Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning Properties of external file

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a MS Access (2003) DB that depends on updates from an external .csv file. I would also like to find and display the DateLastModified Property of that external file. I will display this date in a message box that tells the users what date the external data (.csv) was last updated. The external file (.csv) is located on a server. Let's say: server \\xxx-xx-###\xxxxx_xxxxx\Data Links\BFMreset.csv

Is this the proper VB to use and how would I set it up. Please be specific with my server/file example above.

From VB Help I am looking at:

DateLastModified Property


Description

Returns the date and time that the specified file or folder was last modified. Read-only.

Syntax

object.DateLastModified

The object is always a File or Folder object.

Remarks

The following code illustrates the use of the DateLastModified property with a file:

Sub ShowFileAccessInfo(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = UCase(filespec) & vbCrLf
s = s & "Created: " & f.DateCreated & vbCrLf
s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
s = s & "Last Modified: " & f.DateLastModified
MsgBox s, 0, "File Access Info"
End Sub


Thanks,
 
Your code looks good, and setup for use?

VBA.FileASystem might be easier to use.
Code:
FileDateTime("\\xxx-xx-###\xxxxx_xxxxx\Data Links\BFMreset.csv")

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
CautionMP,

Sorry about the late response. Your suggestion worked greate.

Thanks,

:-D :-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top