473,325 Members | 2,771 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,325 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 3941
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.