Barvna shema: Svetla
Trenutno dejavna stran: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library troubleshooting » Importing a Project file adds the tasks again

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 ProjectUidField isn't set (the UID isn't stored anywhere).

Resolution

  1. Add a Long field for the UID to the task table, and set ProjectUidField to it (designer page Tasks, section MS Project (optional)).
  2. 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.
  3. Import later versions of the file with the default rule. Tasks then find their records by the stored UID, even after they're renamed.
  4. 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