You should unlock the category ptr brfore setting the name. Also you do not
unlock if you do not find the name.
In any case you should rather code this way without directly accessing the
appInfoPtr (though it's a drop slower:
UInt16 i;
char name[dmCategoryLength];
for (i = 0; i<dmRecNumCategories; i++)
{
CategoryGetName (database, i, name);
if (name[0]=='\0')
{
CategorySetName (database, i, trackName);
return i;
}
}
return dmAllCategories; // no room to add...
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/