Well, to answer my own question. I have the following to change
the database 'type'. I call this, if and only if, I verify that the
old 'type' is still being used. It's a bit of an overkill with
all the checking.
I guess I could have just used:
ULong type;
DmSetDatabaseInfo(0, localID, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, &type, NULL);
but instead I use this function.
void UpdateDatabaseType(void) {
Err error;
LocalID localID;
ULong type;
localID = DmFindDatabase(0, DBNAME);
if(localID) {
error = DmDatabaseInfo(0, localID, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, &type, NULL);
}
else {
FrmCustomAlert(altNotice, "LocalID not found!", "Unable to
change", "Database 'type'!");
}
if(type == 'data') {
type = 'Data';
error = DmSetDatabaseInfo(0, localID, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, &type, NULL);
FrmCustomAlert(altNotice, "Database type 'data'", "changed to
'Data'","Ok to proceed!");
}
}
> > >I have seen almost every app use 'appl' as a type for their
> > >application. This seems to violate this rule, if it is one.
> >
> > 'appl' is a Palm OS defined format for applications. No violation there.
> >
> >
> > >If one has a db resource of type 'data' must they change that?
> >
> > Yes, please.
> >
> >
> > >Now assume one has a db resource of type 'data'. What is the best way
> > >to change that from 'data' to 'Data' with the least impact?
> >
> > Well *that's* an open-ended question! :oS
>
> Ok, I have an app that creates a database of type 'data'. Users
> already have stored to that database. What I want to do, on my next
> release of the app, is to change the database (the first time the app is
> run) to type 'Data', without causing any loss of data AND one that does
> not add too much additional code.
>
> So, what I need is an easy solution to renaming the database type
> from 'data' to 'Data'.
>
> > Regards,
> >
> > Jim Schram
> > 3Com/Palm Computing
> > Partner Engineering
> >
> >
>
>
> --
> -----------------------------------------------------------------
> Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
>
> Protect your constitutional rights. Your favorite one may be next!
> -----------------------------------------------------------------
>
--
-----------------------------------------------------------------
Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------