OLD DB Provider to read from Project 2003 mpp-file

H

Henke

Hi
I have read in user groups and googled for information about this topic, but
can't find anything useful. When I try to create a new connection in VS 2003
I can select a Microsoft Project 11.0 OLE DB Provider to be used for my data
access. The problem is that the data source doesn't seems to be a file. I
have tried typing the path and file name for my mpp-file but without success.
Can someone point me in the right direction here?

Thanks!
/Henke
 
J

JackD

There is a help file for this on the Project CD or on computers where
project is installed. Look for prjoledb.htm

Here is a snippet from that file:
----------snip-----------------
Sub Connect()
Dim conData As New ADODB.Connection
Dim rstAssigns As New ADODB.Recordset
Dim intCount As Integer
Dim strSelect As String
Dim strResults As String

conData.ConnectionString =
"Provider=Microsoft.Project.OLEDB.10.0;PROJECT NAME=" & FILE_NAME
' To connect to a Microsoft SQL Server file, you must also supply User ID
and Password arguments
' conData.ConnectionString = "Provider=Microsoft.Project.OLEDB.10.0;User
ID=jsmith;Password=MyPass5;PROJECT NAME=" & FILE_NAME

conData.ConnectionTimeout = 30
conData.Open

strSelect = "SELECT ResourceUniqueID, AssignmentResourceID,
AssignmentResourceName, TaskUniqueID, AssignmentTaskID," & _
" AssignmentTaskName FROM Assignments WHERE TaskUniqueID >
0 ORDER BY AssignmentTaskID ASC"
rstAssigns.Open strSelect
-----------snip--------------
This is from proj2002, so you need the corresponding file for Proj2003.
 
H

Henke

Thanks for your answer.
I wrote OLD DB, but meant OLE DB. The sample you described is for ADO I
would like to use ADO.NET. Is that possible?

/Henke
 
J

JackD

I don't know. It should be possible, but I'm not an expert on it. Read the
document and see if it helps you.
 
R

Rod Gill

Yes, but you can only read from a .mpp file using OLE DB. There is no write
capability.
 

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