If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Table population
Hi,
more help please. Is there a way to enable access to automatically populate a table with a series of files / objects located on a hard disk? cheers |
#2
|
|||
|
|||
John,
The answer is generally Yes. Provide more details, anmd you might even be told How! Nikos "john" wrote in message ... Hi, more help please. Is there a way to enable access to automatically populate a table with a series of files / objects located on a hard disk? cheers |
#3
|
|||
|
|||
Hi Nikos,
I would like to automatically "grab" or copy a number of files / pictures on my hard drive and to place them in a table to support inclusion in a report / form. I have tried to achieve the inclusion of such by manually "dragging and dropping" the objects into OLE formatted tables but this will be overly time consuming within my current project constraints cheers "Nikos Yannacopoulos" wrote in message ... John, The answer is generally Yes. Provide more details, anmd you might even be told How! Nikos "john" wrote in message ... Hi, more help please. Is there a way to enable access to automatically populate a table with a series of files / objects located on a hard disk? cheers |
#4
|
|||
|
|||
John,
You got me there... I don't have much experience with OLE objects, but from what I've seen in the NGs, I think the general suggestion is to just store references to the files on your disk, instead of embedding the objects themselves. Maybe you should seek more advice on this. For what it's worth, here's some sample code that will scan all the .jpg files in a particular folder and put their names in an (existing) table called tblFiles, just as long as the first field is type Text (and big enough to hold long names! better make it 256): Sub filenames_to_table() Dim fldr, fls, fl Dim db As DAO.Database Dim rst As DAO.Recordset Set fs = CreateObject("Scripting.FileSystemObject") Set fldr = fs.GetFolder("C:\FolderName\") Set fls = fldr.Files Set db = CurrentDb() Set rst = db.OpenRecordset("tblFiles") On Error Resume Next For Each fl In fls If Right(fl.Name, 4) = ".jpg" Then rst.AddNew rst.Fields(0) = fl.Name rst.Update End If Next fl On Error GoTo 0 rst.Close End Sub HTH, Nikos "john" wrote in message ... Hi Nikos, I would like to automatically "grab" or copy a number of files / pictures on my hard drive and to place them in a table to support inclusion in a report / form. I have tried to achieve the inclusion of such by manually "dragging and dropping" the objects into OLE formatted tables but this will be overly time consuming within my current project constraints cheers "Nikos Yannacopoulos" wrote in message ... John, The answer is generally Yes. Provide more details, anmd you might even be told How! Nikos "john" wrote in message ... Hi, more help please. Is there a way to enable access to automatically populate a table with a series of files / objects located on a hard disk? cheers |
#5
|
|||
|
|||
Nikos,
I used your code and it worked locally, but when I try to get a list from a network drive nothing happens. Am I missing something? Thanks, Zadok |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table population | john | Using Forms | 2 | November 23rd, 2004 12:09 PM |
Duplicate data | Rob Green | Database Design | 3 | November 7th, 2004 03:08 AM |
Access & OleDb - generating schema changes, problem with identity/counter fields. | Thomas Tomiczek [MVP] | Database Design | 9 | November 5th, 2004 10:32 AM |
Autonumber | Ally H. | General Discussion | 7 | August 27th, 2004 04:51 PM |
Name not showing ID is | René | Setting Up & Running Reports | 11 | June 29th, 2004 01:40 AM |