rnemani
asked on
How do I get the data in a custom field in MS PROJECT using MSACCESS VBA
Hi,
I have the code as shown. In my mpp file I have created a custom field which has data. How can I get the custom field data. Primarily, waht I am looking at is what would be the table name and field name which I could use in lieu of the following:
rstTasksProj.Open "SELECT tasksname FROM tasks ", cnnProj
Please help
I have the code as shown. In my mpp file I have created a custom field which has data. How can I get the custom field data. Primarily, waht I am looking at is what would be the table name and field name which I could use in lieu of the following:
rstTasksProj.Open "SELECT tasksname FROM tasks ", cnnProj
Please help
Dim address, textVal As String
Dim X As Integer
address = dirText.Value & "/mpp/testConsol1.mpp"
Dim cnnProj As New ADODB.Connection 'Ado connection to ms project
Dim rstTasksProj As New ADODB.Recordset 'Project tasks table
'address is simply the location of the MS Project file - could be 'C:/Test.mpp' but would need to be within the " "
cnnProj.Open "Provider = Microsoft.Project.OLEDB.11.0; Project Name =" & address
rstTasksProj.Open "SELECT tasksname FROM tasks ", cnnProj
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim fld As ADODB.Field
Set dbs = CurrentDb
If Not rstTasksProj.EOF Then
Do Until rstTasksProj.EOF
dbs.Execute " INSERT INTO tmpTestName (text1) Values ('" & rstTasksProj.Fields(0).Value & "')"
rstTasksProj.MoveNext
Loop
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER