haquocquan > 22-02-11, 12:45 AM
Sub ListFiles(sPath As String)
Dim FSO As Object
Dim FSOFolder As Object
Dim File As Object
Dim rsFile As Recordset
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(sPath) = True Then
Set FSOFolder = FSO.GetFolder(sPath)
Set rsFile = CurrentDb.OpenRecordset("xulydulieu", dbOpenDynaset)
For Each File In FSOFolder.Files
rsFile.AddNew
rsFile!FileName = File.Name
rsFile.Update
Next File
End If
End Sub