473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Create recordset based on directory read

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
1 3947
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ken Fine | last post by:
I want my application to maintain a directory tree based on months and years, e.g.: 2004 January file file file February file
2
by: Annette Massie | last post by:
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...
2
by: corepaul | last post by:
I am fairly new to Access and I have a problem trying to use bookmarks with a recordset. I have a recordset dimensioned as, Dim rstFoodDesc As ADODB.Recordset ' recordset Dim bMark As...
2
by: ajspacemanspiff | last post by:
I currently have a solution that requires 2 sub queries, where each of them is convereted into a crosstab query and then I join the crosstab queries to a result. I would like to make this more...
1
by: stgraham75025 | last post by:
I am trying to create a pivottable from vs vb.net with no success. I continue to get the same error (Exception from HRESULT: 0x800A03EC). I have a recordset read in and ready to use, but this is...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
2
by: nja2222 | last post by:
I would like to create a page for my clients to login and check for updates on their accounts. Then I would like to create a page where my employees can login and make updates, specifically new file...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.