hello to all
I'm VERY new at VBS. The following code gets the names of all the .mdb files in a specified folder, then
writes these names to a file called TEST3.txt. It works perfectly.
What I want to do instead is write the mdb file names to an ACCESS table. (in TEST4.mdb, table tblTEST5)
Could some kind soul show me how to modify the code to do this? Many thanks in advance.
I'm VERY new at VBS. The following code gets the names of all the .mdb files in a specified folder, then
writes these names to a file called TEST3.txt. It works perfectly.
What I want to do instead is write the mdb file names to an ACCESS table. (in TEST4.mdb, table tblTEST5)
Could some kind soul show me how to modify the code to do this? Many thanks in advance.
Code:
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjFiles
Dim ObjFile
Set fso = CreateObject("Scripting.FileSystemObject") 'Creating File System Object
Set ObjFolder = fso.GetFolder("E:\ARCHIVEa_3") 'Getting the Folder Object
Set ObjOutFile = fso.CreateTextFile("C:\TEST3.txt" 'Creating an Output File to write the File Names
Set ObjFiles = ObjFolder.Files 'Getting the list of Files
For Each ObjFile In ObjFiles 'Writing Name to Output File
If Right(ObjFile.Name, 4) = ".mdb" then
ObjOutFile.WriteLine(ObjFile.Name)
End If
Next
ObjOutFile.Close