Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IMPORTING FILENAMES INTO A TABLE

Status
Not open for further replies.

Huski

Programmer
Jun 11, 2003
1
0
0
AU
Can anyone help,

Still learning a lot about Access 2000 and programming VB. I am in need of a something I can use in an Access database where I have a button which I can browse directories on a computer, select a folder then click a button which imports the filenames (I need it to import image filenames). I not only need the filename, but need to also import the file size (Kb, Mb, etc), file extension and in the case of images, the image size.

Would appreciate any help I can get

Huski
 
Dir$ ???
Or API calls.

Inbuilt - you can use dir$ and getAttr (I think) to get what you need. When you feel adventureous, have a look at using API cals to do the same thing.


Vince
 
This is going to take a good bit of coding.

You can get most of the information from Dir, GetAttr, FileLen, and FileDateTime functions. The image size, if you mean "800x600" or the like, will be much tougher to get. You'll have to open the file and interpret its heading.

Before you consider using the API, check out the "Microsoft Shell Controls and Automation" library (file names differ depending on the version of Access and Internet Explorer, but look for Shell32.dll). It provides an object model that lets you look through the file system hierarchy at will from within code, without the constraints of Dir(). It also provides a BrowseForFolder function that you can use to select a folder from a tree view, without creating your own form--a substantial savings in work required!

The drawback of the Shell Controls library is that the documentation isn't available from within Access. You can find it in MSDN, however.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top