Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Database & Dropdown
Page 1 of 2

Database & Dropdown

PostPosted: Thu Feb 21, 2008 10:13 am
by zyzix
Hi there, me again.

I've developed my "heavy" database application as far i've got. Its useable now, but there is one thing that i could not realize: I want to have a second database called "jobs.pdb" - is it possible to have a second database ? I've seen a lot of other applications which use two or three databases, OrbForms only allows me to set one database in the Application preferences, so i'm not sure. If it's possible: I want a "simple" drop-down menu which shows me all records in the "jobs.pdb". If somebody can i provide an example for this i would really appreciate it!

Thank you for your support. - zyzix

Re: Database & Dropdown

PostPosted: Thu Feb 21, 2008 11:25 pm
by Gazza
You can have as many databases as you want. However, I am not sure how many you can have open at once?

Re: Database & Dropdown

PostPosted: Tue Feb 26, 2008 8:56 am
by zyzix
Thank you Gazza! Has someone out there experience with this ? Are there code-examples ?

Thank you for your support, -zyzix

Re: Database & Dropdown

PostPosted: Tue Feb 26, 2008 5:30 pm
by Gazza
Each database will share the CreatorID assigned to your App. This is useful, so when you delete your application it will also delete all the databases linked to your application through the CreatorID.

Re: Database & Dropdown

PostPosted: Tue Feb 26, 2008 6:16 pm
by nmc
Gazza: not "will" but "should" - you can pass any creatorID to database.create()

Re: Database & Dropdown

PostPosted: Wed Feb 27, 2008 3:13 pm
by zyzix
Hm, can somebody provide an code-example for this ? I've tried it many times in my application (based on the Survey-Example) and i'm stuck - pretty new to OrbForms/PocketC too. I would really appreciate it. Thank you.

- zyzix

Re: Database & Dropdown

PostPosted: Wed Feb 27, 2008 3:56 pm
by nmc
Code: Select all
if (myDB.create("myDBName", "data", app.creator, false)) {
   /*do something with the newly created db*/
}
else
   alert("db creation failed");

Re: Database & Dropdown

PostPosted: Wed Feb 27, 2008 4:01 pm
by zyzix
Ok, i've got that, i'm creating the DB and write an entry in it. Now my bigger question: How do display those values (for example: Rot,Gr?ºn,Blau) into the Dropdown ? So that i would have three entries in it with "Rot", "Gr?ºn," and "Blau". (red,green,blue). Thank you : )

Re: Database & Dropdown

PostPosted: Wed Feb 27, 2008 7:24 pm
by nmc
Try something like this:

Code: Select all
StringList sl;
string txt;
int cnt = db.nrecs, i=0;
DBRecord rec;

while (i<cnt) {
   if (db.getrec(i, rec, true)) {
   rec.read(&txt, typeof(txt), 1);
   rec.close();
   sl.add(txt);
   ++i;
}
list.setitemslist(sl);

Re: Database & Dropdown

PostPosted: Thu Feb 28, 2008 8:38 am
by zyzix
Thank you nmc, this looks promising, i've implemented it and when i'm compiling it, following message appears:
Code: Select all
(62 ): undeclared identifier


on this line:

Code: Select all
if (myDB.create("colors", "data", app.creator, false))


pointing to "myDB.create". Do you know how i can fix this ? Thank you : )

Re: Database & Dropdown

PostPosted: Thu Feb 28, 2008 10:03 am
by nmc
Declare the identifier to avoid the message :-)

Code: Select all
Database myDB;
//your code here
myDB.close();

Re: Database & Dropdown

PostPosted: Thu Feb 28, 2008 12:28 pm
by zyzix
Ah, i'm so stupid :oops: , thanks nmc! The error disapeared but i've got another one on the first line

Code: Select all
StringList sl; (undeclared identifier)
string txt;
int cnt = db.nrecs, i=0;
DBRecord rec;


but as far i get is the StringList sl; there already declared. i mean that's the first time that StringList sl; appears. I've tried to rename my StringList so StringList and sl but the error appears each time, what i'm doing wrong? Thank you very much :) - zyzix

Re: Database & Dropdown

PostPosted: Mon Mar 03, 2008 2:36 pm
by zyzix
Hm, i've looked up my code and i could not find the solution for the "undeclared identifier" error message, is there something to add ? Or do i have to rename any gui-component ? Thank you, - zyzix.

Re: Database & Dropdown

PostPosted: Mon Mar 03, 2008 3:02 pm
by nmc
If you dont show us your code, how do you think we could help you solving your problem?

Its probably a ';' missing on the line above the StringList declaration.

Re: Database & Dropdown

PostPosted: Tue Mar 04, 2008 8:45 am
by zyzix
Okay, i've used your code and replaced the line which occured the error.

Code: Select all
   Database colorDB;
   if (jobDB.create("farben", "data", app.creator, false))
   {
      StringList sl; //Here occurs the error "undeclared identifier"
      string txt;
      int cnt = db.nrecs, i=0;
      DBRecord rec;

      while (i<cnt) {
         if (db.getrec(i, rec, true)) {
            rec.read(&txt, typeof(txt), 1);
            rec.close();
            sl.add(txt);
            ++i;
         }
      list.setitemslist(sl);
      }


Well, sorry but as long i get i'm declaring it the first time there and that looks okay to me (like i would declare something somewhere else). But maybe i'm totally wrong. :oops:

Thank you, - zyzix