Re: Creating Databases Dynamically

2008-05-28 Thread Mike Montalvo
I just finished doing this.  I originally started by using a database of
database names, but then realized it wasnt needed.

My app only requires one DB open at any time. To let the user pick which one
to open, I dynamically fill a List with the names of DBs by seraching for
them by creator ID and type with DmGetNextDatabaseByTypeCreator.  I felt
this is better that the first idea because if something happens to the
Database of Database names, then all those Databases will be sitting on the
palm and not have any way to get to them.

As per the Palm Companion document, I 'behind the scenes' add and remove
 -  with  being my creator ID, to the end of each DB name (the
name is user set) to make them unique.  The user only sees the name that
they typed in, but the actual name of the DB is Users name - CRID

-Mike





Carl Smith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

 Dave-

 Thanks for the great suggestions, I forgot about the number 2 way. Good
 deal.

 I like 2 because coming in and out of the application the database names
are
 always accessible, of then 3 I assume would work that way to, but I have
not
 done much with the feature manager.

 Again thanks for the enlightment Dave,

 Carl


 Dave Carrigan [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  Carl Smith [EMAIL PROTECTED] writes:
 
   Thanks for taking the time to respond to my post, but I do know the
   fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is
 that
   if I am creating an unknown about of databases how would one go about
   creating the name (nameP) of the database and reference this name
across
   mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
   database names in an array and reference them across other c files by
   calling something like DBName[1]? But then how would one make them
 extern to
   other files?
 
  There are lots of ways to approach this.
 
  1. Keep the database names in a global array, linked list, etc. See any
 C programming reference for how to declare global variables that are
 accessible between compilation units.
 
  2. Store the database names in the preferences database and access them
 with the Pref* functions.
 
  3. Store the database names using the feature manager and access them
 with the Ftr* functions.
 
  4. Create the databases with different data types, then search or open
 them using DmGetNextDatabaseByTypeCreator() or
 DmOpenDatabaseByTypeCreator().
 
  --
  Dave Carrigan ([EMAIL PROTECTED])| Yow! NEWARK has been
 REZONED!!
  UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DES MOINES has been
 REZONED!!
  Seattle, WA, USA|
  http://www.rudedog.org/ |
 
 









-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Re: Creating Databases Dynamically

2008-05-28 Thread Dave Carrigan
Carl Smith [EMAIL PROTECTED] writes:

 Thanks for taking the time to respond to my post, but I do know the
 fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is that
 if I am creating an unknown about of databases how would one go about
 creating the name (nameP) of the database and reference this name across
 mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
 database names in an array and reference them across other c files by
 calling something like DBName[1]? But then how would one make them extern to
 other files?

There are lots of ways to approach this.

1. Keep the database names in a global array, linked list, etc. See any
   C programming reference for how to declare global variables that are
   accessible between compilation units.

2. Store the database names in the preferences database and access them
   with the Pref* functions.

3. Store the database names using the feature manager and access them
   with the Ftr* functions.

4. Create the databases with different data types, then search or open
   them using DmGetNextDatabaseByTypeCreator() or
   DmOpenDatabaseByTypeCreator(). 

-- 
Dave Carrigan ([EMAIL PROTECTED])| Yow! NEWARK has been REZONED!!
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DES MOINES has been REZONED!!
Seattle, WA, USA| 
http://www.rudedog.org/ | 


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/


Creating Databases Dynamically

2000-10-26 Thread Carl Smith

Does anyone know of or have suggestions on the possibility of creating DBs
dynamically? In other words I want to create a database(s) as the
application is running. The application would start with one or two static
dbs but as the user needs I would like to create other dbs, depending on the
user's input.

Thanks in advance
Carl



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



RE: Creating Databases Dynamically

2000-10-26 Thread Federico Vaggi

This function creates a database:

Err  DmCreateDatabase (UInt cardNo, CharPtr nameP, ULong creator,  ULong
type, Boolean  resDB)

Where:

 cardNo is the card where the that will be created
nameP   is the name of the database(up to 31 characters)
creator   is the creator id.
type  is the type.
resDB   if true, will create a resourse database. (You must set this false)

 This function returns 0 if no error, or the error code  if an error occurs



Federico Vaggi
Irion S.A.
Av. Cordoba 795 - 1Piso Of. 2
(1054) Cap.Fed. - Bs.As.
T/4315-5556 int. 118
F/ 4315-8260

- Mensaje original -
De: "Carl Smith" [EMAIL PROTECTED]
Para: "Palm Developer Forum" [EMAIL PROTECTED]
Enviado: Thursday, October 26, 2000 11:05 AM
Asunto: Creating Databases Dynamically


 Does anyone know of or have suggestions on the possibility of creating DBs
 dynamically? In other words I want to create a database(s) as the
 application is running. The application would start with one or two static
 dbs but as the user needs I would like to create other dbs, depending on
the
 user's input.

 Thanks in advance
 Carl



 --
 For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Creating Databases Dynamically

2000-10-26 Thread Carl Smith

Federico-

Thanks for taking the time to respond to my post, but I do know the
fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is that
if I am creating an unknown about of databases how would one go about
creating the name (nameP) of the database and reference this name across
mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
database names in an array and reference them across other c files by
calling something like DBName[1]? But then how would one make them extern to
other files?

Any body out there have any input?

Carl

"Federico Vaggi" [EMAIL PROTECTED] wrote in message
news:28122@palm-dev-forum...

 This function creates a database:

 Err  DmCreateDatabase (UInt cardNo, CharPtr nameP, ULong creator,  ULong
 type, Boolean  resDB)

 Where:

  cardNo is the card where the that will be created
 nameP   is the name of the database(up to 31 characters)
 creator   is the creator id.
 type  is the type.
 resDB   if true, will create a resourse database. (You must set this
false)

  This function returns 0 if no error, or the error code  if an error
occurs



 Federico Vaggi
 Irion S.A.
 Av. Cordoba 795 - 1Piso Of. 2
 (1054) Cap.Fed. - Bs.As.
 T/4315-5556 int. 118
 F/ 4315-8260

 - Mensaje original -
 De: "Carl Smith" [EMAIL PROTECTED]
 Para: "Palm Developer Forum" [EMAIL PROTECTED]
 Enviado: Thursday, October 26, 2000 11:05 AM
 Asunto: Creating Databases Dynamically


  Does anyone know of or have suggestions on the possibility of creating
DBs
  dynamically? In other words I want to create a database(s) as the
  application is running. The application would start with one or two
static
  dbs but as the user needs I would like to create other dbs, depending on
 the
  user's input.
 
  Thanks in advance
  Carl
 
 
 
  --
  For information on using the Palm Developer Forums, or to unsubscribe,
 please see http://www.palmos.com/dev/tech/support/forums/






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Creating Databases Dynamically

2000-10-26 Thread Dave Carrigan

"Carl Smith" [EMAIL PROTECTED] writes:

 Thanks for taking the time to respond to my post, but I do know the
 fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is that
 if I am creating an unknown about of databases how would one go about
 creating the name (nameP) of the database and reference this name across
 mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
 database names in an array and reference them across other c files by
 calling something like DBName[1]? But then how would one make them extern to
 other files?

There are lots of ways to approach this.

1. Keep the database names in a global array, linked list, etc. See any
   C programming reference for how to declare global variables that are
   accessible between compilation units.

2. Store the database names in the preferences database and access them
   with the Pref* functions.

3. Store the database names using the feature manager and access them
   with the Ftr* functions.

4. Create the databases with different data types, then search or open
   them using DmGetNextDatabaseByTypeCreator() or
   DmOpenDatabaseByTypeCreator(). 

-- 
Dave Carrigan ([EMAIL PROTECTED])| Yow! NEWARK has been REZONED!!
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DES MOINES has been REZONED!!
Seattle, WA, USA| 
http://www.rudedog.org/ | 

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Creating Databases Dynamically

2000-10-26 Thread Carl Smith

Dave-

Thanks for the great suggestions, I forgot about the number 2 way. Good
deal.

I like 2 because coming in and out of the application the database names are
always accessible, of then 3 I assume would work that way to, but I have not
done much with the feature manager.

Again thanks for the enlightment Dave,

Carl


"Dave Carrigan" [EMAIL PROTECTED] wrote in message
news:28129@palm-dev-forum...

 "Carl Smith" [EMAIL PROTECTED] writes:

  Thanks for taking the time to respond to my post, but I do know the
  fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is
that
  if I am creating an unknown about of databases how would one go about
  creating the name (nameP) of the database and reference this name across
  mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
  database names in an array and reference them across other c files by
  calling something like DBName[1]? But then how would one make them
extern to
  other files?

 There are lots of ways to approach this.

 1. Keep the database names in a global array, linked list, etc. See any
C programming reference for how to declare global variables that are
accessible between compilation units.

 2. Store the database names in the preferences database and access them
with the Pref* functions.

 3. Store the database names using the feature manager and access them
with the Ftr* functions.

 4. Create the databases with different data types, then search or open
them using DmGetNextDatabaseByTypeCreator() or
DmOpenDatabaseByTypeCreator().

 --
 Dave Carrigan ([EMAIL PROTECTED])| Yow! NEWARK has been
REZONED!!
 UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DES MOINES has been
REZONED!!
 Seattle, WA, USA|
 http://www.rudedog.org/ |





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Creating Databases Dynamically

2000-10-26 Thread Mike Montalvo

I just finished doing this.  I originally started by using a database of
database names, but then realized it wasnt needed.

My app only requires one DB open at any time. To let the user pick which one
to open, I dynamically fill a List with the names of DBs by seraching for
them by creator ID and type with DmGetNextDatabaseByTypeCreator.  I felt
this is better that the first idea because if something happens to the
Database of Database names, then all those Databases will be sitting on the
palm and not have any way to get to them.

As per the "Palm Companion" document, I 'behind the scenes' add and remove
" - " with  being my creator ID, to the end of each DB name (the
name is user set) to make them unique.  The user only sees the name that
they typed in, but the actual name of the DB is "Users name - CRID"

-Mike





Carl Smith [EMAIL PROTECTED] wrote in message news:28136@palm-dev-forum...

 Dave-

 Thanks for the great suggestions, I forgot about the number 2 way. Good
 deal.

 I like 2 because coming in and out of the application the database names
are
 always accessible, of then 3 I assume would work that way to, but I have
not
 done much with the feature manager.

 Again thanks for the enlightment Dave,

 Carl


 "Dave Carrigan" [EMAIL PROTECTED] wrote in message
 news:28129@palm-dev-forum...
 
  "Carl Smith" [EMAIL PROTECTED] writes:
 
   Thanks for taking the time to respond to my post, but I do know the
   fundamentals of the PalmOS. Maybe I wasn't clear, but my situation is
 that
   if I am creating an unknown about of databases how would one go about
   creating the name (nameP) of the database and reference this name
across
   mutiple c files. Such as DBName1, DBName2 and etc. Could one keep the
   database names in an array and reference them across other c files by
   calling something like DBName[1]? But then how would one make them
 extern to
   other files?
 
  There are lots of ways to approach this.
 
  1. Keep the database names in a global array, linked list, etc. See any
 C programming reference for how to declare global variables that are
 accessible between compilation units.
 
  2. Store the database names in the preferences database and access them
 with the Pref* functions.
 
  3. Store the database names using the feature manager and access them
 with the Ftr* functions.
 
  4. Create the databases with different data types, then search or open
 them using DmGetNextDatabaseByTypeCreator() or
 DmOpenDatabaseByTypeCreator().
 
  --
  Dave Carrigan ([EMAIL PROTECTED])| Yow! NEWARK has been
 REZONED!!
  UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | DES MOINES has been
 REZONED!!
  Seattle, WA, USA|
  http://www.rudedog.org/ |
 
 







-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/