I think that there is a misunderstanding in the meaning of IDs and ParentIDs. In your table, IDs (field "itemid", misspelled as "ietmid") begin at 1 and run up to the highest record. The parentIDs (field "cateid") start at 1, too, and run up to some value. This means that there is a overlap of ID and ParentID values. The problem is that this does not create the correct child-parent relationship.
Suppose you have a table listing plants and animals. Each record has an ID value and, of course, the name of the plant or animal. Just a few elements:
ID Name
1 dog
2 flower
3 cat
4 tree
Suppose you want to display these items in a tree and classify them as "plant" or "animal". In order to do this you add the items "plant" and "animal" to the table, give them the next ids (5 for "plant", 6 for "animal"). And you add another column with the ParentID. This is either 5, when the record lists a plant, or 6, when the record lists an animal. So, the table finally is
ID ParentID Name
1 6 dog
2 5 flower
3 6 cat
4 5 tree
5 0 plant
6 0 animal
The 0 assigned to the ParentID of the "plant" and "animal" items indicates that these are top-level node attached directly to the root of the tree.
I attempted to restructure the table so that it follows this principle. The basic idea is to add new items for the category nodes. In order to have IDs for them which do not overlap with the existing IDs I replaced the current "cateid" values by their negatives:
UPDATE StockParts SET cateid=-cateid
Then I added the category nodes - since there are only a few categories I did this manually using "SQLite Expert Personal", but you certainly can find an SQL instruction to do this in a program. The records with the forder cateid=6, now with cateid=-6, have category="PS". In order to put all these record below the common "PS" node I added a new record with "category"="PS", "itemid"=-6 and "cateid"=0. The latter means: this is a top level node. "itemid=-6" means: all records will become child nodes of it. This was repeated for the other categories.
I know, it is a bit hard to explain...
The final database file is attached.