> -----Original Message-----
> From: Chris Faherty [mailto:[EMAIL PROTECTED]]
> 
> On 07-Oct-99 David Fedor in his arrogance :) :) wrote:
> 
> >>So I just changed it to (&& corrected):
> >>
> >>    if ((DmGetNextDatabaseByTypeCreator(true, &searchInfo, 
> DatebookDBType,
> >>        DatebookAppID, true, &cardNo, &dbID) != 0) ||
> >>        ((DatebookDB = DmOpenDatabase(cardNo, dbID, mode | 
> dmModeReadOnly))
> >>        == 0))
> >>        return false;
> > 
> > Actually this code still does look for the latest version 
> of the file -
> > that's what the "true" parameter means.  Set it to false 
> and you'll get
> > even more speed.
> 
> Whoa!  I did what you said (set to false) and it really flies 
> now!  But then I
> also tried a suggestion by Danny Epstein in which one loop is 
> used to find
> all databases:
> 
>     MainDB = 0;
>     DatebookDB = 0;
>     ToDoDB = 0;
>     AddressDB = 0;
> 
>     while ((DmGetNextDatabaseByTypeCreator(newSearch, 
> &searchInfo, 'DATA',
>         NULL, false, &cardNo, &dbID) == 0) &&
>         (!DatebookDB || !ToDoDB || !AddressDB || !MainDB)) {
>         if (DmDatabaseInfo(cardNo, dbID, NULL, NULL, NULL, 
> &cdate, &mdate,
>             NULL, NULL, NULL, NULL, NULL, &creator)) break;
>         if (creator == DatebookAppID) {
...
>         } else if (creator == ToDoAppID) {
...
>         } else if (creator == AddressAppID) {
...
>         } else if (creator == MainAppID) {
>             MainDB = DmOpenDatabase(cardNo, dbID, dmModeReadWrite);
>         }
>         newSearch = false;
>     }
> 
> Now it rips through the file opens very quickly.  In fact, 
> now my program
> launches just as fast as calculator!  Sweet!
> 

You mean it's quicker to iterate through ALL databases and
compare for the dbID you're looking for yourself than it 
is to use the API to match the dbID?


-- 
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi./sec ... not just a good idea, it's the LAW!

Reply via email to