Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using TTable Range

Status
Not open for further replies.

bill147

Programmer
Jul 11, 2003
5
US
I am using TTable with a Foxpro database.
When I apply a range to the table the following functions
do not return.
RecordCount
FindLast()
Last()

I can use Next() or FindNext() on the records until I
reach the last record in the range, then this function
will also crash.

Am I trying to use range in the wrong way.

Bill
 
Show us some code.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
A simple example:

i = Table1->RecordCount; // works ok
Table1->ApplyRange(); // works ok
i = Table1->RecordCount; // this line just never returns

I also have noticed if I link the table to a dbgrid control sometimes when I scroll down to see the last record the dbgrid control crashes the application.

I have tried 2 different database files with the same results.

If I use a query control instead of the table control then it all works ok.

Bill
 
I have now found that if I use foxpro to reindex the data file the index file is now about one third the size it was before.
Also the problem with the BDE commands goes away.

The field that the index is on is a date field.

Inorder to reindex in the BDE I use the batchcopy control to make a temporary copy then use the empty command to delete the records and then batchappend to recreate the index. When I do this my problems come back again.

Bill
 
I've seen this with the BDE batch command and FoxPro before but it didn't register.

It looks like you have two options. 1) Reindex after the batch command, or 2) skip the batch command and do everything via code.



James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
I was only using the batch command because I did not know how to reindex in the BDE. I could not any command to do this.

Bill
 
The only time I've programmed for FoxPro was to move records from a file into some tables. I've always had the user reindex using another program. I've never programmaticaly reindexed those tables.


James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top