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
[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 insertion removal not right order

database insertion removal not right order

Discuss PocketC for CE (including Desktop Edition)

Postby bvinas on Tue Mar 27, 2001 1:59 am

I insert records into a database as follows:

/*insert sorted records*/
for (i=0;i<cnt;i++){
recid = dbrecwrite(0,CEVT_LPWSTR,1,descr[i]);
recid = dbrecwrite(recid,CEVT_LPWSTR,2,amount[i]);
recid = dbrecwrite(recid,CEVT_LPWSTR,3,dates[i]);
}

and I read them as follows:

for(j=0;j<reccnt;j++)
{
//get the jth record from top of db
dbseek(CEDB_SEEK_BEGINNING,j);
cnt=dbrecpropcnt();
for(i=0;i<cnt;i++)
{
t_str=dbrecpropval(i);
//store in lists
if (i==0) {
lbinsstr(CTL_LISTDESCR,j, t_str);
}
else if (i==1) {
lbinsstr(CTL_LISTAMOUNT,j, t_str);
}
else {
lbinsstr(CTL_LISTDATE,j, t_str);
}

}

}

I get all the records in the db, but not in the same order I inserted them. Does anyone know why? In the docs, it said the records should be pushed down as they are inserted, but nevertheless, still in the same order.

any help would be greatly appreciated.

bobby
bvinas
 
Posts: 43
Joined: Mon Feb 12, 2001 8:15 pm
Location: USA

Postby pocketware on Thu Mar 29, 2001 3:28 am

I see what you are saying, I have the same situation, the records get added to the Database in random order, I don't know why,
I tried to establish a pattern, but couldn't figure it out. Then again, I am also new to PocketC.

Anybody knows the answer ?

Also is there any PocketC function to sort a database after it has been created ?
pocketware
 
Posts: 12
Joined: Thu Mar 29, 2001 3:24 am
Location: USA

Postby pocketware on Thu Apr 05, 2001 2:45 am

BUMP UP.
pocketware
 
Posts: 12
Joined: Thu Mar 29, 2001 3:24 am
Location: USA

Postby cao on Thu Apr 05, 2001 3:01 am

Hmm, i need to take a look at it to see if it is the behavior of the default CE database API or problem located at PocketC database wrapper functions.
cao
 
Posts: 60
Joined: Tue Dec 05, 2000 4:11 am
Location: USA

Postby guy on Sat Apr 07, 2001 3:42 pm

Isn't there something to do with setting up the indexexes in the real CE API?

I remember reading something about it, but it was a while back.



Guy
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby pocketware on Mon Apr 09, 2001 4:49 am

From the eVC++ help files:



"<b>Creating a Database</b>
Use the CeCreateDatabaseEx function to create a database in any volume. CeCreateDatabaseEx identifies the volume, names the database, identifies the sort order, and lets you pass in a user-defined type identifier.<font color=red> The sort order is an index that is applied to a database to manipulate the record ordering.</font id=red> Although you define the sort order when the database is created, you can alter the sort order later. The type identifier, while it is user-defined, is commonly used to identify similar types of databases."


"<b>Modifying the Sort Order</b>
When you are creating a database, you can define up to four different sort orders. Typically, each record in a database contains a similar set of properties, and each type of property shares the same property identifier. For example, each record in a Contacts database might contain a name, street address, city, state or province, postal code, and telephone number. All name properties would have the same property identifier, all street addresses would have the same property identifier, and so on. You can <font color=red>select one of these properties and direct the system to sort the records, based on that property.</font id=red> However, you cannot perform a sort on a binary property. The order in which the records are sorted affects the order in which the CeSeekDatabase database-seeking function finds records in the database."



Is this what you are talking about Guy ?


Thanks.
pocketware
 
Posts: 12
Joined: Thu Mar 29, 2001 3:24 am
Location: USA

Postby guy on Mon Apr 09, 2001 7:11 am

Yes, that was the one. I don't remember the documentation being that clear when I read it, but this was before the evc kit and I had to search the Microsoft library for it.

I also don't remember the restriction that you couldn't have binary keys, or the restriction on the number of indexes.

I haven't played with the PocketC database functions yet. Is there an interface to the index features of the CE API?

Guy
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby pocketware on Mon Apr 09, 2001 4:36 pm

The PocketC help says that all new records will be added at the top, pushing older records down. I don't think there is any PocketC function currently available that allows you to modify the sort order, and that's why bvinas was trying to add them already pre-sorted, but with no luck.
pocketware
 
Posts: 12
Joined: Thu Mar 29, 2001 3:24 am
Location: USA

Postby bvinas on Wed Apr 11, 2001 10:28 pm

That is correct. I have been really busy at work, and had not had any more time to play around with it.


bobby
bvinas
 
Posts: 43
Joined: Mon Feb 12, 2001 8:15 pm
Location: USA


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron