A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table population



 
 
Thread Tools Display Modes
  #1  
Old November 23rd, 2004, 05:19 AM
john
external usenet poster
 
Posts: n/a
Default 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  
Old November 23rd, 2004, 10:16 AM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default

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  
Old November 23rd, 2004, 11:51 AM
john
external usenet poster
 
Posts: n/a
Default

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  
Old November 24th, 2004, 12:50 PM
Nikos Yannacopoulos
external usenet poster
 
Posts: n/a
Default

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  
Old January 10th, 2005, 09:17 PM
Zadok @ Port of Seattle
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.