Read MPP file<[email protected]>

J

John

Private Sub Command1_Click()
Dim rstMpp
Dim sSQLMpp
Dim sConnMpp
'Dim dbcon
'Dim DSN
'Dim UID
'Dim UIp
Dim iCnt As Integer

sFileName = "C:\Documents and Settings\Admin\My Documents\mpp2.mpp"

sConnMpp = "Provider=Microsoft.Project.OLEDB.11.0;Project Name=" & sFileName & ";"

' Shorter Query
sSQLMpp = "SELECT TaskId, TaskName, TaskStart, TaskFinish, TaskOutlineLevel, TaskOutlineNumber from Tasks"


sSQLMpp = "SELECT * from Tasks"

Set rstMpp = CreateObject("ADODB.Recordset")
rstMpp.Open sSQLMpp, sConnMpp
rstMpp.MoveFirst

Do While Not rstMpp.EOF

' Bits I'm interested in
Debug.Print "---------------------------------------------"
Debug.Print "TaskId " & rstMpp("TaskId")
Debug.Print "TaskName " & rstMpp("TaskName")
Debug.Print "TaskStart " & rstMpp("TaskStart")
Debug.Print "TaskFinish " & rstMpp("TaskFinish")
Debug.Print "TaskOutlineLevel " & rstMpp("TaskOutlineLevel")
Debug.Print "TaskOutlineNumber " & rstMpp("TaskOutlineNumber")
Debug.Print vbCrLf


' Everything
For iCnt = 1 To 318
Debug.Print rstMpp(iCnt).Name & " " & rstMpp(iCnt)
Next iCnt
Debug.Print "---------------------------------------------"
Debug.Print vbCrLf & vbCrLf & vbCrLf & vbCrLf

rstMpp.MoveNext
Loop
rstMpp.Close

End Sub


EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 

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