?
Solved

Paradox tables repeatedly "reverting" on a local install

Posted on 2002-04-19
10
Medium Priority
?
265 Views
Last Modified: 2010-04-04
Hi all,

I have an application which is currently running on just one machine. I am running paradox tables using the BDE. On one table, it seems like after every third or fourth update, the data reverts to a previous state.

The application keeps track of totals of numbers and how they got that way, the 'total' record is updated from a 'charges' record. The next time a 'charge' is made, a new charges records is made and the 'totals' record is updated to reflect what the new total is.

Every so often, the database holding the totals goes back to a previous set of data, from 3, 4, or 5 sets of transactions ago.

I can see the behavior reflected in the data (the charge table keeps track of the total before and after it is updated) but I can't replicate the problem on my machine.

This may be a BDE setting problem, any suggestions? I am currently using posts on the records.

Leo
0
Comment
Question by:oneeye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
10 Comments
 

Expert Comment

by:lottol
ID: 6955734
try to add after post next string:

 Table1.FlushBuffers;

where Table1 is your TTable object
0
 
LVL 1

Expert Comment

by:adeng
ID: 6956563
I don't really understand the procedure of updating the record that you're using, can you post your code here.... (but simplify it first)...

Regards
Adeng
0
 

Author Comment

by:oneeye
ID: 6957098
Here is the chunk of code. I'm going to be rewriting it in SQL eventually, but the really odd thing is that it works fine on three machines, but the "ttable" periodically goes back three of four transactions, as I said in the initial problem statement.

   ttable.indexname := 'RankIndex';
   ttable.Edit;
   ttable.first;
   while not ttable.eof do
      begin
      {grab the keys here}
         if chgtable.FindKey([detkey,perkey,listkey]) then
            begin
               ttable.edit;
               if (ttable.fieldbyname('total').asinteger
                  <> chgtable.fieldbyname('newtotal').asinteger)
                  then begin
                     ttable.fieldbyname('datestamp').asdatetime := date;
                     ttable.fieldbyname('timestamp').asdatetime := time;
                  end;
               ttable.fieldbyname('total').asinteger
                  := chgtable.fieldbyname('newtotal').asinteger;
            end
         else ChgTable.insertrecord([1,detkey,perkey,listkey,ttemp,1,ttemp,rankkey]);
         ttable.post;
         chgtable.Edit;
         chgtable.fieldbyname('stamp').asfloat := now;
         filldetailform.ttable.next;
      end;
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
adeng earned 600 total points
ID: 6957525
here's the first problem :

  ttable.Edit;
  ttable.first;

If you put First procedure after edit then the record will be post..

in the "While not eof" loop, after,
  chgtable.edit;
  chgtable.fieldbyname('stamp').asfloat := now;

you did'nt put "chgtabel.POST"

I don't know here but this line :
  filldetailform.ttable.next;

what if you change it to
  ttable.next; (no filldetailform) ?

BTW, I think TQuery is better then TTable, .

Regards,

Adeng.



0
 

Author Comment

by:oneeye
ID: 6957543
Yes, I quite agree, now that I have started using them. (Tqueries, that is) The stray form declaration happened because for a time, I was getting an unable to find table error.

I'll check to see if the chargetable's are posting properly.

Leo
0
 

Expert Comment

by:lottol
ID: 6958786
As far, as I've worked with Paradox. It's better to use TTable, not TQuery, because Paradox isn't SQL DB. It just simulates it. Using TQuery takes much time and sometimes it doesn't work correctly.
0
 
LVL 1

Expert Comment

by:adeng
ID: 6958997
You right about that, but in the case of using windows, TQuery is quit stable than TTable. when using TTable and windows, the table crash quite often (index out of date, etc.)
0
 

Expert Comment

by:lottol
ID: 6959607
"Index out of date" happens mostly in those situations, when you copy table "on fly" or don't use exclusive mode for updating records in tables, which are accessed by many users.
I can say that it's impossible to wait queries, if you have multiple users, besides Paradox isn't the best DB for multiple users. :)
0
 

Author Comment

by:oneeye
ID: 6960217
Adenq:

Thanks for the tips on the code, I'll mark it as answered, though in the interim I tracked my problem to another piece of code altogether, heh.

I've been converting this application from using filtered tables to Tquery for the past week or so. The speed difference isn't all that visible on my 2 gig machine, but boy it is obvious on the 300 mhz pIII one of the applications is installed on. Opening up a filtered table takes a 10 count using TTable, it is less than a second opening the same table using a Tquery.

Using Ttable, I kept getting index out of date about once every 3 months, often enough that I wrote a small application to fix it when it happened. If that problem goes away with using mostly read only Tqueries, that will make me very happy.

Leo
0
 
LVL 1

Expert Comment

by:adeng
ID: 6960437
Dear Leo,

Nevermind, nice to help you solve the problem. My project using more than 100 table, very complex logic and more than 4 year in the market, and get no problem very much with paradox table.

Best Regards
Adeng
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question