UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Store Directory Data To A Table (next Ver), Any Version    
 
   
CyberCow
post Oct 14 2006, 03:04 PM
Post#1


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


UPDATED: June 22, 2010
Sometimes, I just need to copy an entire directory listing (and optionally all of its subdirectories and filenames) into a table so I can play with or compare the contents. Also, once in a table, I can use that info to perform other file functions through VBA.
Written in Access 97, versions A97, A2K, A2K3 and A2K7 are included in the attachment. All three flavors tested well in their respective vesrions and all convert up to A2K10. Several folks here at UA have contributed this by virtue of having similar discussions in partial veins. What this does different is that it provides the option to acquire subdirectories as well. Among them are Freakazeud, Ben Purser, Glen Kruger, ghudson, Larry Larsen and others. Dev Ashish supplied the Browse Folder Dialog API.
This version also allows for several subdirectory levels deep (as suggested by UA member: Paul Sussex). Up to 12.

(click image above to download if attachment doesn't work)
How it works: There is a template table named 'USysTblFileDirTemplate' - this provides the base for a new table that the user will name. Then, the user selects a directory to gather info from. Once the directory is selected, opt to get all subdir info as well. After execution, a success message will appear and the new table is viewable with the "View Your Table" button. (Note: Selecting a greater number of subdirectories than exist will not be a problem)
Two Library References are used in this demo: 'Microsoft Scripting Runtime' & 'DAO'. And because I'm guessing that folks who want this tool will generally incorporate this feature into an existing database, there is no fancy interface; just a simple, easy to use set of controls and prompts to acquire file directory information into a table.
I've used this tool to get the info from two similarly named directoies on our network to do some comparison analysis and it proved quite handy. I hope you find it usefull as well.
Tested in A97, A2K, A2K3, A2K7 & A2K10
Attached File(s)
Attached File  dirtotable.zip ( 259.72K )Number of downloads: 599
 
Go to the top of the page
 
bluedanube
post Oct 17 2013, 01:34 AM
Post#2



Posts: 282
Joined: 15-July 13



That's very handy! Thanks for another example to the filesystem scripting.
The file extension is limited to size=3, I would use the RInstr or similar to seek the rightmost dot character. Something useful to this seems to sit in the functions of the module.
Is the Dir$ in VBA faster or slower?
Would a process that can read many hundred thousand directory names into SQL Server be interesting?
It shells out a DIR /B/S/AD into a temp file, then the server does a BULK read.
Unfortunately the DIR can take some hours, while the server takes a minute.
Go to the top of the page
 
dodoman
post Jan 27 2014, 12:15 PM
Post#3



Posts: 11
Joined: 20-January 13



Man!! This works really well, I appreciate your time and effort to put this together. Thanks a bunch, Bill K.
Go to the top of the page
 
tonez90
post Jan 27 2014, 10:47 PM
Post#4



Posts: 212
Joined: 20-March 06
From: Darwin, Australia


There are other ways of doing a directory recurse. I have attached another way (a little complicated but you wil get the drift.
This may be of some use to some people.
This works in Win 7 64 bit (designed using Access 2k03 up to Access 2K10
Attached File(s)
Attached File  Cataloger_19_February_2013.zip ( 484.01K )Number of downloads: 233
 
Go to the top of the page
 
AlCatraz
post Mar 17 2014, 02:10 PM
Post#5



Posts: 13
Joined: 15-January 13



TO: Tones90
ARE CATALOGER
I have WIN 8.1 64X == ACCESS 2010
I added the PtrSafe --
But it I get an error 2683 NO OBJECT IN CONTROL
Is this supposed to run om my settings?
FOr am I doing something wrong?
THNX
Go to the top of the page
 
tonez90
post Mar 17 2014, 08:58 PM
Post#6



Posts: 212
Joined: 20-March 06
From: Darwin, Australia


Hi,
Odont have Win8.1 but I do use win 7 64 bit version with MS Access 2010. I dont have this problem. I will look into this and repost an update when done.
IS what do you mean that you added 'PtrSafe'
Go to the top of the page
 
CyberCow
post Jun 10 2014, 06:34 AM
Post#7


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


tonez90 - Is your version of Access 2010 the 64-bit or 32-bit version. The 64-bit version is what requires the ptrSafe.
Go to the top of the page
 
tonez90
post Jun 17 2014, 06:40 PM
Post#8



Posts: 212
Joined: 20-March 06
From: Darwin, Australia


Hi I have Access 2010 running on windows 64bit machine (Win 7)
Go to the top of the page
 
CyberCow
post Jun 17 2014, 07:59 PM
Post#9


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


At the risk of repeating myself: "Is your version of Access 2010 the 64-bit or 32-bit version?"
Go to the top of the page
 
tonez90
post Jun 18 2014, 07:37 PM
Post#10



Posts: 212
Joined: 20-March 06
From: Darwin, Australia


Sorry I misunderstood your question.
The Access is v14.0.6129.5000 (32 bit).
Go to the top of the page
 
CyberCow
post Jun 19 2014, 06:13 AM
Post#11


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


tonez90 - OK, the 32-bit version does NOT require the use of "ptrSafe". hat_tip.gif
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    14th December 2017 - 01:18 AM