Check the error code for the first DmGetLastErr() and tally it with the
error codes you can find in DataMgr.h
It starts in line 185 on the SDK3.5 version.
Eliah Ninyo wrote:
>
> hello,
>
> i bought the "Palm Programming: the developer's guide" and read the
> chapter
> about databases.
>
> in the chapter there is a function called OpenOrCreateDB which i'm using
> at
> my app.
> (i also look at the full sale code include inthe book CD)
>
> here is the func':
>
> static Err OpenOrCreateDB (DmOpenRef *dbP, ULong type, ULong creator,
> ULong
> mode,
> UInt
> cardNo, char *name, Boolean *created)
> {
>
> Err err;
>
> *created = false;
> *dbP = DmOpenDatabaseByTypeCreator (type, creator, mode);
>
> err = DmGetLastErr();
>
> if (! *dbP)
> {
> err = DmCreateDatabase (0, name, creator, type, false);
> if (err)
> return (err);
>
> *created = true;
>
> *dbP = DmOpenDatabaseByTypeCreator (type, creator, mode);
> if (! *dbP)
> return DmGetLastErr();
>
> }
>
> return (err);
>
> }
>
> (i cut-and-paste from the source code, and it is exactly like in my
> app)
>
> while i'm doing debuging with the CW i watch the dbP identifier and it
> is
> 0x0000000. there isn't a watch about *dbP.
> after the line "*dbP = DmOpenDatabaseByTypeCreator (type, creator,
> mode);"
> the dbP is 0x000000. (according to the watch), and when it comes to the
> line that say "if (! *dbP)" it doesn't get into the if and jump to the
> end
> of the func' ("return (err)").
>
> i don't understant why it is? after all the dbP is 0x000000 so after the
> if
> it should get into it (into the if) but it doesn't. because of this the
> create identifier doesn't become "true" and it
> influants all my app'.
>
> so if some one can help me plz do.
>
> 10x in advance :-)
> ELIAH NINYO
>
> [EMAIL PROTECTED]
>
> ("`-''-/").___..--''"`-._
> `6_ 6 ) `-. ( ).`-.__.`)
> (_Y_.)' ._ ) `._ `. ``-..-'
> _..`--'_..-_/ /--'_.' ,'
> (il).-'' (li).' ((!.-'
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/