Opening External Access Files


A

Arturo

Access 2003 Question
For reasons I don’t want to go into, I am using an FTP process to solve a
network problem. Each location, of which there are over 200, has a team of
four people. I have a process in place that uploads any new data or changes
made by any member of the team. I am working from the directory “C:\ab c\.â€
Whenever another member opens their program, it checks the FTP site for files
from other team members, and downloads them to a directory “C:\ab c\new.â€
(Note: ab c has a space.) There could be no files, one file, or there could
be many.

Each of these files has a key in them. When they open, if the key is
correct, the Autoexec macro runs a procedure that appends new data to the
other team member’s BE file, edited data updates the corresponding record in
their BE, the file closes, and another process deletes them out of the
directory.

My problem is this. I have a Shell command that downloads the files. I have
a batch file that deletes them out. But, I can’t get the files to open. Given
the example below, how would I get it to work? The script needs to know when
there are no files to download and also when all the downloaded files have
been opened.

Example: The files Data1.mdb and Data2.mdb are downloaded into “C:\ab
c\new.†Now, how do I get them to open?

Thanks.
 
Ad

Advertisements

S

Stefan Hoffmann

hi Arturo,
Example: The files Data1.mdb and Data2.mdb are downloaded into “C:\ab
c\new.†Now, how do I get them to open?
Double-click them. Ok, what do you mean by get them open?

A can imagine two ways:

1. using adhoc SQL, code-controlled. Enumerate the files and create
select queries with a SQL like

SELECT * FROM [c:\ab c\new\data1.mdb].[Table1]

2. use DAO (ADO) to open the database and records in code, e.g.

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = OpenDatabase("C:\ab c\new\data1.mdb")
Set rs = db.OpenRecordset("Table1", dbOpenSnapshot)
' do something with the data...
rs.Close
Set rs = Nothing
Set db = Nothing



mfG
--> stefan <--
 
A

Arturo

Let me try to be a little clearer.

Each person will be working from a file “C:\ab c\Main.mdb.†When they work
in their database and close it, additions and updates are recorded in a
linked database. This linked database is uploaded to the FTP site, renamed
with the team identifier, the date, and the time. Example:
team1_10-06-09-09-30-00. A new blank version of that linked database is
downloaded for the next set of additions or changes.

When someone opens their program, it opens a different file, “C:\ab
c\Temp.mdb.†This file runs the procedures to download the new files, open
them one at a time, and then delete them. When this process is complete,
“C:\ab c\Temp.mdb†closes and then opens “C:\ab c\Main.mdb,†which is the
actual working database.

The part I am missing is the part that opens the newly downloaded files one
at a time, and in dated order. Upon opening, these files will self-extract,
appending new data to the user’s BE database and updating the records that
were edited.



Stefan Hoffmann said:
hi Arturo,
Example: The files Data1.mdb and Data2.mdb are downloaded into “C:\ab
c\new.†Now, how do I get them to open?
Double-click them. Ok, what do you mean by get them open?

A can imagine two ways:

1. using adhoc SQL, code-controlled. Enumerate the files and create
select queries with a SQL like

SELECT * FROM [c:\ab c\new\data1.mdb].[Table1]

2. use DAO (ADO) to open the database and records in code, e.g.

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = OpenDatabase("C:\ab c\new\data1.mdb")
Set rs = db.OpenRecordset("Table1", dbOpenSnapshot)
' do something with the data...
rs.Close
Set rs = Nothing
Set db = Nothing



mfG
--> stefan <--
 
Ad

Advertisements

S

Stefan Hoffmann

hi Arturo,
The part I am missing is the part that opens the newly downloaded files one
at a time, and in dated order. Upon opening, these files will self-extract,
appending new data to the user’s BE database and updating the records that
were edited.
I see, use ShellExecute, e.g.

http://www.mvps.org/access/api/api0018.htm


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top