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

Database & Dropdown

Discuss OrbForms Designer and PocketC Architect

Database & Dropdown

Postby zyzix on Thu Feb 21, 2008 10:13 am

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
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby Gazza on Thu Feb 21, 2008 11:25 pm

You can have as many databases as you want. However, I am not sure how many you can have open at once?
Gazza
 
Posts: 146
Joined: Sat Jan 12, 2002 1:56 am
Location: United Kingdom

Re: Database & Dropdown

Postby zyzix on Tue Feb 26, 2008 8:56 am

Thank you Gazza! Has someone out there experience with this ? Are there code-examples ?

Thank you for your support, -zyzix
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby Gazza on Tue Feb 26, 2008 5:30 pm

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.
Gazza
 
Posts: 146
Joined: Sat Jan 12, 2002 1:56 am
Location: United Kingdom

Re: Database & Dropdown

Postby nmc on Tue Feb 26, 2008 6:16 pm

Gazza: not "will" but "should" - you can pass any creatorID to database.create()
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Database & Dropdown

Postby zyzix on Wed Feb 27, 2008 3:13 pm

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
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby nmc on Wed Feb 27, 2008 3:56 pm

Code: Select all
if (myDB.create("myDBName", "data", app.creator, false)) {
   /*do something with the newly created db*/
}
else
   alert("db creation failed");
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Database & Dropdown

Postby zyzix on Wed Feb 27, 2008 4:01 pm

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 : )
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby nmc on Wed Feb 27, 2008 7:24 pm

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);
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Database & Dropdown

Postby zyzix on Thu Feb 28, 2008 8:38 am

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 : )
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby nmc on Thu Feb 28, 2008 10:03 am

Declare the identifier to avoid the message :-)

Code: Select all
Database myDB;
//your code here
myDB.close();
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Database & Dropdown

Postby zyzix on Thu Feb 28, 2008 12:28 pm

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
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby zyzix on Mon Mar 03, 2008 2:36 pm

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.
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Database & Dropdown

Postby nmc on Mon Mar 03, 2008 3:02 pm

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.
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Database & Dropdown

Postby zyzix on Tue Mar 04, 2008 8:45 am

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
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Next

Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 1 guest

cron