Insert/update values from a ms project

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxpirate
    New Member
    • Dec 2009
    • 37

    Insert/update values from a ms project

    Im trying to read a ms project file and insert milestone data into a table my code looks like this
    Set prjProject = prjApp.Projects (1)

    For i = 1 To prjProject.Task s.Count
    If prjProject.Task s(i).Milestone = "True" Then

    rst.AddNew
    rst!Desc = prjProject.Task s(i).Name
    rst!Milestone_B aseline = prjProject.Task s(i).Baseline1S tart
    rst!Milestone_P lan = prjProject.Task s(i).Baseline1S tart
    rst.Update

    End If


    Next i
    What i want is i need to do is if a milestone is already present then i need to update it.
    the milestone table has a projectid, milestoneid and milestone description along with other fields
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    You have multiple solutions to this problem.
    Personally I would probably import a new set of data in a (temp) new table.
    Next perform a DELETE query on the "main" table to remove the dupes with the new file and finally append the temp table with the main table to get the actual up to date info.
    Remains the set of milestones that aren't present in the new data and obviously are ended or deleted.
    These could also be identified on forehand with the temp table and "marked" when needed.

    Nic;o)

    Comment

    Working...