#1  
Old 21st February 2013, 02:11 PM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default Next is not getting all records

This loop only goes two times but my database has more than 100 records! WHY??
The two records that shows when I step through the database are always the same But there is no logical order.
First is not giving the first record.
Setting LimmitCount has no effect.
The testfile TEST_PHP_NEXUS.PHP works fine and show all my records

Example:
class Page1 extends Page
{
public $SpinEdit1 = null;
// Value = 0
public $Button1 = null;
public $Table1 = null;
// Database = Database1
// Active = True;
public $Database1 = null;
// Driver = nexus
// Host = localhost
// Port = 16000
// DatabaseName = Your Database
// Connected = True

function Button1Click($sender, $params)
{
$this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
$this->Table1->First();
while (! $this->Table1->EOF )
{
$this->Table1->next();
$this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
}
}
}
  #2  
Old 21st February 2013, 07:53 PM
Alexander Telegin [NDX]
 
Posts: n/a
Default Re: Next is not getting all records

Micael, please send entire project at alex@itlab.ws.

- Alex

On 2/21/2013 8:11 AM, Micael wrote:
> This loop only goes two times but my database has more than 100 records!
> WHY??
> The two records that shows when I step through the database are always
> the same But there is no logical order.
> First is not giving the first record.
> Setting LimmitCount has no effect.
> The testfile TEST_PHP_NEXUS.PHP works fine and show all my records
>
> EXAMPLE:
> class Page1 extends Page
> {
> public $SpinEdit1 = null;
> // Value = 0
> public $Button1 = null;
> public $Table1 = null;
> // Database = Database1
> // Active = True;
> public $Database1 = null;
> // Driver = nexus
> // Host = localhost
> // Port = 16000
> // DatabaseName = Your Database
> // Connected = True
>
> function Button1Click($sender, $params)
> {
> $this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
> $this->Table1->First();
> while (! $this->Table1->EOF )
> {
> $this->Table1->next();
> $this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
> }
> }
> }
>
>


  #3  
Old 21st February 2013, 09:48 PM
Franz-Leo Chomse [NDX]
 
Posts: n/a
Default Re: Next is not getting all records

On Thu, 21 Feb 2013 15:11:19 +1100, Micael
<Micael.5r3gq8@nx-forums.nexusdb.com> wrote:


>function Button1Click($sender, $params)
>{
>$this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
>$this->Table1->First();
>while (! $this->Table1->EOF )
>{
>$this->Table1->next();
>$this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
>}


You never get the first record. Next should be the last
statement in the loop block, since first has already activated
one record.


Regards from Germany

Franz-Leo Chomse [NexusDB Expert]
franz.leo.chomse@ndx.nexusdb_x.com (please remove "_x" to reply)
  #4  
Old 22nd February 2013, 02:40 PM
Alexander Telegin [NDX]
 
Posts: n/a
Default Re: Next is not getting all records

Hi Micael,

I tested your code with Northwind -> Customers table and it successfully
ran through all records. And yes, as Franz-Leo mentioned, you never get
the first record.

- Alex

On 2/21/2013 8:11 AM, Micael wrote:
> This loop only goes two times but my database has more than 100 records!
> WHY??
> The two records that shows when I step through the database are always
> the same But there is no logical order.
> First is not giving the first record.
> Setting LimmitCount has no effect.
> The testfile TEST_PHP_NEXUS.PHP works fine and show all my records
>
> EXAMPLE:
> class Page1 extends Page
> {
> public $SpinEdit1 = null;
> // Value = 0
> public $Button1 = null;
> public $Table1 = null;
> // Database = Database1
> // Active = True;
> public $Database1 = null;
> // Driver = nexus
> // Host = localhost
> // Port = 16000
> // DatabaseName = Your Database
> // Connected = True
>
> function Button1Click($sender, $params)
> {
> $this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
> $this->Table1->First();
> while (! $this->Table1->EOF )
> {
> $this->Table1->next();
> $this->SpinEdit1->Value = $this->SpinEdit1->Value + 1;
> }
> }
> }
>
>


  #5  
Old 23rd February 2013, 06:42 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

I have completly reinstalld HTML5 and the nexusPHP
Problems are the same so what to do
  #6  
Old 23rd February 2013, 06:57 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

I have completly reinstalld HTML5 and the nexusPHP
Problems are the same so what to do
  #7  
Old 23rd February 2013, 09:53 AM
Ad Franse [NDX]
 
Posts: n/a
Default Re: Next is not getting all records

Op 22-2-2013 21:42, Micael schreef:
> I have completly reinstalld HTML5 and the nexusPHP
> Problems are the same so what to do
>
>

publish your program + tables here

tell us what you do and the error(s) you get

Ad Franse
  #8  
Old 24th February 2013, 05:57 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

Everything is exactly as described in th first post
I Just made a very simple TestDatabase with 12 records (IDfield and namefield)
and the results are as described. If You leave a mail adress I can mail the whole test project with database.
  #9  
Old 2nd March 2013, 02:30 AM
Micael Micael is offline
Member
 
Join Date: Mar 2011
Posts: 78
Default

Anywone who might know whats wrong with my installation???
  #10  
Old 2nd March 2013, 05:16 AM
Franz-Leo Chomse [NDX]
 
Posts: n/a
Default Re: Next is not getting all records

On Sat, 2 Mar 2013 03:30:15 +1100, Micael
<Micael.5rj8bi@nx-forums.nexusdb.com> wrote:

>
>Anywone who might know whats wrong with my installation???


If you still use your originl source you have two problems.

1. The first record you activated with First is ignored, since
the Next statement skips at once to the second one.

2. On the last record EOF is still False, so Next is executed
and you do not have a valid record anymore. In this case
the displayed values are undefined. Most likely the duplicate
record values are the one of the last record.


3. You do not specify an Index. The order of the records depends
on the Index used and without specifing one, the last set on is
used.


Regards from Germany

Franz-Leo Chomse [NexusDB Expert]
franz.leo.chomse@ndx.nexusdb_x.com (please remove "_x" to reply)


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I uae a parameter to specify all of the records peter@infopos.com.au nexusdb.public.support.sql 5 8th August 2008 11:20 AM
Records and RecN in EM Malcolm Cheyne nexusdb.public.support 5 25th November 2007 09:15 PM
More on copying records Robert Meek nexusdb.public.support 5 22nd July 2005 01:46 AM
Can't edit records in EM Anton Feiertag nexusdb.public.support 1 31st March 2004 08:42 AM
EM - RC5 - Delete Records Roy Granich nexusdb.public.support 1 25th August 2003 04:16 PM


All times are GMT +11. The time now is 09:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.