Creating Tables from folder contents

B

Brian

I'm trying to create a table from the contents of an FTP
folder but don't know if this is possible. Can someone
answer the basic question (is it possible)?

Of course, if you can direct me in the process or at
least tell me where to acquire the code to do so I would
be very appreciative.
 
M

Media Lint

Of course it's possible ... will it require superhero
cunning and a comfortable command of API? Almost
certainly.
 
B

Brian

Frankly, super villians are typically far more cunning
than super heros.

As far as comfortable command of API, not so much. But I
have already pieced together the code to download files
from an FTP site. (And it seems to work very well.) Now
I need the code (or commands) to create a table from the
contents of that same folder so I can automatically
determine what I've downloaded and what needs to be
downloaded.

Isn't it amazing the length we go to avoid future work?
 
D

Dev Ashish

Now
I need the code (or commands) to create a table from the
contents of that same folder so I can automatically
determine what I've downloaded and what needs to be
downloaded.

Look at CreateTableDef in Help. However, you'll most likely want to define
a table up-front and save the FTP folder path and list of files in it;
instead of creating a new table for each folder. But not knowing the
design, I could be wrong.

-- Dev
 
B

brian

Let me try to clarify what I want to do...

I am creating a database of transaction data from daily
text files provided online by an online vendor.

My goal is to create an automated set of procedures that
will 1)look at the Ftp folder provided by the vendor, 2)
compare those contents to a list of files already
included in the database, 3)download the oldest file that
not already in the database, 4)update the transaction
database with relevant information from the downloaded
file and 5)update the table of files already in the
database. Then I'd like to loop this process until there
are no files in the ftp folder that are not included in
the database.

Any thoughts?
 
D

Dev Ashish

My goal is to create an automated set of procedures that
will

So, you really don't need to create a new table each time; instead
compare contents of the folder with existing records in a table.

The pseudo-code would look something like this:

Connect using your FTP code.
1)look at the Ftp folder provided by the vendor,

Get the first file listing.
2) compare those contents to a list of files already
included in the database,

Use SQL to compare against the table. If no match found then follow next
steps:
3)download the oldest file that not already in the database,
4)update the transaction
database with relevant information from the downloaded
file and
5)update the table of files already in the
database.

Repeat from step 1.
Then I'd like to loop this process until there
are no files in the ftp folder that are not included in
the database.

-- Dev
 
Top