Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / April 2005

Tip: Looking for answers? Try searching our database.

Ms Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jimbob62 - 23 Apr 2005 12:09 GMT
I have a table where I want to match up product names with a .jpg picture of
the product. All the .jpg product picture files are in a folder on my hard
drive
Using VBA is there any way to read the name of each .jpg file in the folder
and place the file name in one of the table fields (Image). I would want to
iterate over all the files in the folder and place all the file names in the
table (one record each). Of course I still have to relate the field
"Product_Name" to Image so that the correct picture is displayed, but let's
assume that that can be done. I now want to be able to just extract the file
name from the folder to place in the table and form
Jack MacDonald - 23 Apr 2005 15:06 GMT
Yes - the Dir() function will retrieve the names of the files in the
nominated folder. You can use the value it returns in an SQL statement
to INSERT the name into your table.

- aircode  from memory - syntax may be wrong but you get the idea -

sFileName = Dir("myFolder\*.jpg")
do while len(sfilename) > 0
ssql = "insert into myTable (filefield) values (" & sfilename & ")"
currentdb.execute ssql
sfilename = dir()
loop

>I have a table where I want to match up product names with a .jpg picture of
>the product. All the .jpg product picture files are in a folder on my hard
[quoted text clipped - 6 lines]
>assume that that can be done. I now want to be able to just extract the file
>name from the folder to place in the table and form

**********************
jackmacMACdonald@telusTELUS.net
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.