By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Create recordset based on directory read

P: n/a
I have a bunch of images stored in a folder on the harddrive. Is there
a way for Access 2000 to read the directory and write a record for the
images found? Eventually the records need to be exported to an ASCII,
comma delimited file.

For example, say there is a folder on C called 1357. Withing 1357 I
have images called 0587002, 0587003, 0587004, 05870042(this is the
second page of 0587004).

Can I create records in a table that would look like this:

ImageID Pages Location
0587002 Page1 C:\1357\0587002.tif
0587003 Page1 C:\1357\0587003.tif
0587004 Page1 C:\1357\0587004.tif
0587004 Page2 C:\1357\05870042.tif

Then I would like to export the file with these records...

"0587002","Page1","C:\1357\0587002.tif"
"0587003","Page1","C:\1357\0587003.tif"
"0587004","Page1","C:\1357\0587004.tif"
"0587004","Page2","C:\1357\05870042.tif"

Thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This is the basic idea to load all the files in "C:\" into a table named
"MyTable" with a field named "Filename":

Dim rs As DAO.Recordset
Dim strFile As String

Set rs = dbEngine(0)(0).OpenRecordset("MyTable")
strFile = Dir$("C:\*.*")
Do While Len(strFile) > 0&
rsSource.AddNew
rsSource!Filename = strFile
rsSource.Update
strFile = Dir$ 'Next file
Loop

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Annette Massie" <an******@co.saint-croix.wi.us> wrote in message
news:c6**************************@posting.google.c om...
I have a bunch of images stored in a folder on the harddrive. Is there
a way for Access 2000 to read the directory and write a record for the
images found? Eventually the records need to be exported to an ASCII,
comma delimited file.

For example, say there is a folder on C called 1357. Withing 1357 I
have images called 0587002, 0587003, 0587004, 05870042(this is the
second page of 0587004).

Can I create records in a table that would look like this:

ImageID Pages Location
0587002 Page1 C:\1357\0587002.tif
0587003 Page1 C:\1357\0587003.tif
0587004 Page1 C:\1357\0587004.tif
0587004 Page2 C:\1357\05870042.tif

Then I would like to export the file with these records...

"0587002","Page1","C:\1357\0587002.tif"
"0587003","Page1","C:\1357\0587003.tif"
"0587004","Page1","C:\1357\0587004.tif"
"0587004","Page2","C:\1357\05870042.tif"

Thanks!

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.