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
[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 - Really Simple Database

Really Simple Database

Discuss PocketC for Palm OS (including Desktop Edition)

Really Simple Database

Postby zyzix on Thu Jan 31, 2008 12:14 pm

Hi there, i'm new in this forum and have a question about Databases:

I want to create a simple Database with the fields: project-id (Text), job-id (Text), startdate(Date), enddate(Date), notice (Text). - I'm usually working with MySQL and i could write such a database in seconds, however - i don't get the clue about the PocketC Databases and how they're work. When i'm writing in the program header @dbname "mydatabase1"; and add to the code (sample code from the PocketC runtime):

Code: Select all
main()
{
string strn;
dbcreate("mydatabase1");
dbwrite((string)"dachdecken");
dbclose();

dbopen("mydatabase1");
strn=dbread('s');
puts ("Job-ID: "+strn+"\n");
dbclose();

while (getc() != 'x')
{sleep(1);}

exit();
}


This is okay - but now, how i can add values to "project-id", "job-id", "startdate", "enddate", and "notice" ? How can i point to the different fields ? I have downloaded many examples and searching trough different forums and didn't find any explaination of the Database Layout of PocketC.

I hope everything is clearly because my english is not very good.

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

Re: Really Simple Database

Postby dewey on Fri Feb 01, 2008 5:28 am

In Palm OS, a database is just a file with multiple "records". Each record is just a series of bytes. Higher level concepts such as individual fields, are not directly supported. Instead, use the dbwritex() function to write multiple fields per record.

The @dbname directive specifies the name of the "database" that the application will create. This is equivalent to the name of a .exe file. So, you don't want to be using the same name for @dbname as you would use to store data.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Re: Really Simple Database

Postby zyzix on Mon Feb 04, 2008 8:44 am

dewey wrote:Instead, use the dbwritex()


Thanks Dewey, o.k it makes sense, i've found a working example for me which actually works now, but it don't uses dbwritex() - i would appreciate it if there's any example out there which uses dbwritex() - another question: how do i put the actual date into the database ? I have a button called "Start" and if this button is activated, it should write the actual date into the db, is that a simple thing to do ? Thank you.
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Really Simple Database

Postby zyzix on Fri Feb 08, 2008 10:41 am

Sorry for the doublepost, just bought the OrbForms Designer and checked out the Survey Example - exactly what i needed!
Thank you for the support.
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am


Return to PocketC for Palm OS

Who is online

Users browsing this forum: No registered users and 3 guests

cron