Re: Folder

From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 08/17/04


Date: Mon, 16 Aug 2004 23:48:44 -0400


"Vina" <tvae@att.net> wrote in message
news:774d01c48408$6d256ab0$a601280a@phx.gbl
> Dirk,
>
> Thanks for this, it work really great but one more
> question. How can i add to get the full path of the file.
> I am planning to just search the whole C:\ drive so i
> need to get the full path for the files found.
>
> Really appreciate your help.
>> -----Original Message-----
>> "Vina" <tvae@att.net> wrote in message
>> news:741401c483c6$362b09d0$a601280a@phx.gbl
>>> is it possible to create something that it will look at a
>>> certain folder and look for MDB's in that folder and then
>>> to look on the details on that folder to when it was
>>> modified and write all these in a table. It is possible
>>> to be done in access.
>>>
>>> Can someone give me an idea how to go about this.
>>>
>>> Thanks
>>> Vina
>>
>> Sure. Something like this "air code":
>>
>> '----- start of code -----
>> Dim db As DAO.Database
>> Dim strFolder As String
>> Dim strFileName As String
>> Dim dtFileDate As String
>>
>> strFolder = "C:\Temp\"
>>
>> Set db = CurrentDb
>>
>> strFileName = Dir(strFolder & "*.mdb")
>> Do Until Len(strFileName) = 0
>> db.Execute _
>> "INSERT INTO tblMDBList " & _
>> "(FileName, FileDate) " & _
>> "VALUES('" & _
>> strFileName & _
>> "', " & _
>> Format(FileDateTime(strFolder & strFileName), _
>> "\#mm/dd/yyyy hh:nn:ss AMPM\#") & _
>> ")", _
>> dbFailOnError
>>
>> strFileName = Dir()
>> Loop
>>
>> Set db = Nothing
>> '----- end of code -----

Change this:

>> "VALUES('" & _
>> strFileName & _
>> "', " & _

to this:

                "VALUES('" & _
                   strFolder & strFileName & _
                   "', " & _

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)


Relevant Pages

  • Re: How to return a variable to a listbox on the form.
    ... > go out and select an Excel file. ... Function fncSheetNames(strPath As String) As String ... Dim tdf As DAO.TableDef ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.modulesdaovba)
  • Re: Protecting a Drop Down text Box - Block text entry.
    ... Any help appreciated Dirk ... Dim dbCurr As Database, rst As Recordset ... Dim strSQL_Lookup As String ... but if the user types in a selection - even if it matches one ...
    (microsoft.public.access.formscoding)
  • Re: How to return a variable to a listbox on the form.
    ... > function or the strAllSheets, ... >>> Dim XLFile As String ... >>> Dim XLSheet As String ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.modulesdaovba)
  • Re: Add Time
    ... Allen & Dirk for your advice - a much better route to follow ... > Function SecondsToTimeAs String ... > Dim strHours As String ... > Dim lngMinutes As Long ...
    (microsoft.public.access.formscoding)
  • Re: Folder
    ... "Vina" wrote in message ... > certain folder and look for MDB's in that folder and then ... Dim strFolder As String ... Dim strFileName As String ...
    (microsoft.public.access.modulesdaovba)