MS Project & ADO

T

Taz

Hi,

I am querying the tasks from a MS Project file to get their WBS and
PercentComplete.
Getting these values works fine, but once they get updated (e.g. the
%complete changes from 25 to 100), I can't seem to get the new values.
I keep getting the 25 instead of the 100

If the file gets saved, then, after a while, I get the new value.
Why is it that I don't get the new value immediately? Is there some kind of
delay?

Is it possible to get the new values, even when te file is not saved?

Here is the code I use:

Public Sub GetData()
Dim strSQL As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Const strConn As String = "Provider=Microsoft.Project.OLEDB.10.0;PROJECT
NAME=C:\test.mpp"
cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient
cn.Open(strConn)
strSQL = "SELECT * FROM Tasks WHERE TaskNumber1 = '1'"
rs.Open(strSQL, cn)
If Not rs.EOF Then
TextBox1.Text += "id = " & rs("TaskWBS").Value & " / %complete = " &
rs("TaskPercentComplete").Value & vbCrLf
Else
TextBox1.Text += "not found!"
End If
cn.Close()
rs = Nothing
cn = Nothing
End Sub
 
L

Lars Hammarberg

You do not have a "link" with an application - you have a query against the
contents of a saved file...

/Lars Hammarberg
www.camako.se
Microsoft Project Premier Solution Provider
 

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