Importing a Project file adds the tasks again
ImportFromProject adds records for tasks that are already in the table, so the plan contains them
twice, or the import dialog box lists tasks as new that should be change or same.
Environment
WKL Forms Object Library with WklGantt (ImportFromProject, type library 1.7 or later), with files
from Microsoft Project or from ExportToProject.
Cause
The import finds a record by the rule set in MatchBy. With the default, wgiAuto, that rule is
the key when ProjectUidField isn't set: the task's UID must equal the key. That works for files
that ExportToProject wrote from a table with a Long or AutoNumber key, but not for:
- A plan started in Project. Its UIDs (1, 2, 3, …) are unrelated to the table's keys, or they match other records.
- A table with a text or composite key, or new tasks added with AutoNumber keys, when
ProjectUidFieldisn't set (the UID isn't stored anywhere).
Resolution
- Add a Long field for the UID to the task table, and set
ProjectUidFieldto it (designer page Tasks, section MS Project (optional)). - Import once by name through the dialog box, and check every proposed record:
ImportFromProject "Plan.xml", wgiName, False, True. The import stores the UIDs in the new field. - Import later versions of the file with the default rule. Tasks then find their records by the stored UID, even after they're renamed.
- Delete the duplicates from the earlier import by hand, or after step 2, import once with
DeleteMissing:=True(this deletes every record that isn't in the file).
en/wiki/msaccess/comctl/troubleshooting/import-adds-tasks-again.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille