473,804 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\0587004 2.tif

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

"0587002","Page 1","C:\1357\058 7002.tif"
"0587003","Page 1","C:\1357\058 7003.tif"
"0587004","Page 1","C:\1357\058 7004.tif"
"0587004","Page 2","C:\1357\058 70042.tif"

Thanks!
Nov 12 '05 #1
1 3978
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!Filena me = 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.sa int-croix.wi.us> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
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\0587004 2.tif

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

"0587002","Page 1","C:\1357\058 7002.tif"
"0587003","Page 1","C:\1357\058 7003.tif"
"0587004","Page 1","C:\1357\058 7004.tif"
"0587004","Page 2","C:\1357\058 70042.tif"

Thanks!

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3343
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
434
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 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...
2
8614
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 Variant ' variable to store bookmark I open the recordset with the statements,
2
6081
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 dynamic and allow for users to filter, and to do so I would like to be able to create the resulting query all in VBA code. I can create a recordset of each inital query, but is there a way to run a query on that, and then subsequently, a query...
1
6934
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 where I get the error. objpcache = wkbk.PivotCaches.Add _(SourceType:=Excel.XlPivotTableSourceType.xlExternal) objpcache.Recordset = obRecordset (error is here) I do not want to write out the recordset and then use a range for the pivottable...
5
6782
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 cause. If I could create a large file that could be encrypted, and maybe add files to it by appending them and putting in some kind of delimiter between files, maybe a homemade version of truecrypt could be constructed. Any idea what it...
23
7425
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 in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
8
3483
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 , etc. I want to go to the first row, do a WHERE statement, return the
2
2785
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 uploads, to the clients accounts. I have seen similar sites everywhere, such as bank websites, USPS site, et cetera. What is required to accomplish this? I'm trying to do this with the PHP, MySQL and Adobe CS3 Master collection's 'Dreamweaver CS3' ...
0
9714
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9174
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.