?
Solved

Paradox table not refreshing

Posted on 2003-11-10
2
Medium Priority
?
219 Views
Last Modified: 2012-05-04
I have a Delphi 5 application accessing a paradox dataabase. The database is on a server. I want to get the next invoice number from a table and then incrament it number by one. The application works fine on a single machine but when I try to access the the next number from a different machine the paradox table has not been updates. It is only updatede when the application is turned off. I am using the following sql

insert into invoiceno
  (InvoiceNo)
values
  (:InvoiceNo)  

select max(InvoiceNo) as newNumber from InvoiceNo

Is there a reason why the table does not update across the network. I have cached updates set to false

Thanks
0
Comment
Question by:fisace
[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
2 Comments
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 800 total points
ID: 9714419
>It is only updatede when the application is turned off. I am using
>the following sql

usually caused by misconfigured bde-settings

checks
- netdirpath
  - pointed to a shared directory (read/write access rights)
  - this entry must be char by char the same on all clients

- databasepath (where the tables resides)
  - this entry must be char by char the same on all clients
    (also the driveletter must be the same on all clients)

- local share
    - if above not helps after check and maybe readjustment,
      try the opposite value of this parameter

hope this helps

meikl ;-)  

0
 
LVL 17

Accepted Solution

by:
geobul earned 1200 total points
ID: 9714489
Hi,

In a multiuser environment I suggest you to create a new table with one record only (and perhaps one field) containing the last given invoice number. Then your application should use a transaction for getting the next number this way:

var InvoiceNo: integer;
begin
...
Database1.StartTransaction;
try
  // get current number
  Query1.Close;
  Query1.SQL.Text := 'SELECT InvoiceNum FROM Table2'; // Table2 is that table
  Query1.Open;
  InvoiceNo := Query1.Field[0].AsInteger;
  Query1.Close;
  // increment the number
  Inc(InvoiceNo);
  // save the new number
  Query1.SQL.Text := 'UPDATE Table2 SET InvoiceNum = ' + IntToStr(InvoiceNo);
  Query1.ExecSQL;
  // do your insert here - insert new record in the invoice table with InvoiceNo
  // ...
  Database1.Commit;
except
  Database1.Rollback;
end;

Regards, Geo
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 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