I have been trying to use the code below to get the creation date from a list of files and by matching the name of the file to a record in an access database putting the creation date for the match.
It is not working. I am wondering if instead of using a vb form to do this, if it would be easier/better to do this through code in access.
Any Help?
PLEASE!?!
Thanks,
JO
Current code:
Code:Dim db As ADODB.Connection Dim rs As ADODB.Recordset Dim filesys As FileSystemObject Dim fol As Folder Dim fil As File Dim ssql As String Set db = New ADODB.Connection Set rs = New ADODB.Recordset Set filesys = New FileSystemObject With db .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionString = "Data Source=" & App.Path & "\db1.mdb" .Open End With rs.LockType = adLockOptimistic rs.CursorType = adOpenDynamic rs.ActiveConnection = db ssql = "Select * From WOINFO" rs.Open ssql Set fol = filesys.GetFolder("d:\DCtest\") For Each fil In fol.Files rs.MoveFirst Do Until rs.EOF 'If fil.Name = rs("WONumber") Then 'rs("ScanDate") = fil.DateCreated 'rs.Update 'End If List1.AddItem (fil.DateCreated) rs.MoveNext Loop Next fil rs.Close Set rs = Nothing db.Close Set db = Nothing Set filesys = Nothing Set fil = Nothing Set fol = Nothing




Reply With Quote