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
[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 - Date into Database

Date into Database

Discuss OrbForms Designer and PocketC Architect

Date into Database

Postby zyzix on Mon Feb 11, 2008 2:06 pm

Hello there!

I've just bought OrbForms Designer and build upon the (great!) Survey example my database application. I've added new fields, dropdowns etcetera. BUT it looks like i don't get the hang of the "date" functions. I wan't to add two Buttons: "Start" and "Stop". Both Buttons should do exactly the same: Write the actual date and time into the database. I even don't know how to display the date. Is there actually an example how to do this ? Thank you for your support. - zyzix
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Date into Database

Postby nmc on Mon Feb 11, 2008 11:05 pm

Try:

Date dbDate;
...
<assign value from your db to dbDate>
...
alert(dbDate.date());

docs: library reference / System / Date / date
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Date into Database

Postby zyzix on Tue Feb 12, 2008 2:03 pm

I've put that into the handler for pushStart and declared the date dbdate but somehow, nothing happens. No Build failure or something similar, i'm very beginner in PocketC (usually Develop in Delphi). Can you explain the <assign value from your db to dbDate> part a little bit more ? Thank you. - zyzix
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Date into Database

Postby nmc on Wed Feb 13, 2008 12:42 am

The following code is untested:

Code: Select all
Database db;
Date startDate;
DBRecord rec;

if (db.open("test", true)) {
   if (db.getrec(0, &rec, true)) {
      rec.read(&startDate, typeof(startDate), 1);
      rec.close();
      alert(startDate.date());
   }
   db.close();
}


Put this in your handler and replace "test" with the actual name of your (existing) database.
nmc
 
Posts: 197
Joined: Tue May 27, 2003 8:42 pm
Location: Germany

Re: Date into Database

Postby zyzix on Wed Feb 13, 2008 9:41 am

Hello there nmc!

First of all, thank you for your patience : ) I've added the part into the handler, but i'm getting
Code: Select all
cast required between incompatible types

in this line
Code: Select all
if (db.getrec(0, &rec, true)) {


i've modified it so that i could compile, but then on the PALM, following Message appears: Func:pushStart.onselectRecord must be created/opened first ...so i think i'm on the wrong way..
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am

Re: Date into Database

Postby Percival on Wed Feb 13, 2008 2:42 pm

Try removing the & from &rec

Code: Select all
if (db.getrec(0, rec, true)) {
Percival
 
Posts: 45
Joined: Sat Jul 19, 2003 10:31 am
Location: Netherlands

Re: Date into Database

Postby zyzix on Wed Feb 13, 2008 4:00 pm

Thank you both very much, works now : )
zyzix
 
Posts: 24
Joined: Wed Jan 23, 2008 10:24 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 3 guests

cron