Import tables into Access

N

NevilleT

I want to import data from MS Project into an Access application. I thought
I could programatically save the project file as an mdb file from Access then
import the table I need into my Access database using transferdatabase. So
far I have been unable to save the project file as an Access database from
Access. Has anyone done this before? I keep getting an error. I can
connect to project, and read data using an SQL but cannot save the Project
file as an mdb.
The code is

Dim strTempDB As String
strTempDB = "C:\temp\temp.mdb"
FileSaveAs Name:=strTempDB, FormatID:="MSProject.MDB8"

I want to avoid writing an SQL query to transfer around 90 fields from one
table and another 30 from a second table.
 
E

Earl Lewis

NevilleT,

If you want to do this from Access you need to create a project application object in your Access code. Once you create the project object you can open a specified project file and then you can run your FileSaveAs, using the project application object of course.

Is there any reason that you need to do this from within Access instead of doing it from Project directly?

Earl
I want to import data from MS Project into an Access application. I thought
I could programatically save the project file as an mdb file from Access then
import the table I need into my Access database using transferdatabase. So
far I have been unable to save the project file as an Access database from
Access. Has anyone done this before? I keep getting an error. I can
connect to project, and read data using an SQL but cannot save the Project
file as an mdb.
The code is

Dim strTempDB As String
strTempDB = "C:\temp\temp.mdb"
FileSaveAs Name:=strTempDB, FormatID:="MSProject.MDB8"

I want to avoid writing an SQL query to transfer around 90 fields from one
table and another 30 from a second table.
 
N

NevilleT

Hi Earl
Thansks for replying. The reason for doing it from the Access end is that we
are producing some reporting on a number of projects from a central Access
application and the person producing the reporting wants to update from one
application rather than open and save each project file as an Access file.

I have created a project application object and all that part is working. I
can even use an sql statement to insert data into a table in Access. It
would be much simpler however to just import the whole TASK table from
Project into Access.
 
R

Rod Gill

If you have Project 2000 onwards you can simply use oledb to read from
Project .mpp files. Search for the file prjoledb.htm in one of Project's
Program folders for details.
 

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