D
Douglas J. Steele
You can use the Dir function to retrieve all of the files in a folder, and
use INSERT INTO statements to load them into a table.
Assuming your table is named FileList, and has a field FileNM, something
like the following untested aircode should work:
Dim strFolder As String
Dim strFile As String
Dim strSQL As String
strFolder = "C:\My Documents"
strFile = Dir(strFolder & "\*.*")
Do While Len(strFile) > 0
strSQL = "INSERT INTO FileList (FileNM) " & _
"VALUES (" & Chr$(34) & strFile & Chr$(34) & ")"
CurrentDb.Execute strSQL, dbFailOnError
strFile = Dir
Loop
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
this? I found a way to send it to a List Box but that's not what I want.
use INSERT INTO statements to load them into a table.
Assuming your table is named FileList, and has a field FileNM, something
like the following untested aircode should work:
Dim strFolder As String
Dim strFile As String
Dim strSQL As String
strFolder = "C:\My Documents"
strFile = Dir(strFolder & "\*.*")
Do While Len(strFile) > 0
strSQL = "INSERT INTO FileList (FileNM) " & _
"VALUES (" & Chr$(34) & strFile & Chr$(34) & ")"
CurrentDb.Execute strSQL, dbFailOnError
strFile = Dir
Loop
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
send that list to a table but I couldn't find a way. Is there a way to doBroadcasttech.Net said:Hello
I searched the newsgroup for a way to get a file list of a directory and
this? I found a way to send it to a List Box but that's not what I want.