Solved

Paradox table not refreshing

Posted on 2003-11-10
2
215 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
2 Comments
 
LVL 27

Assisted Solution

by:kretzschmar
kretzschmar earned 200 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 300 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Wininet read php file from internet issue 6 92
Convert Jpg /PNG To GIF 5 138
Convert GUI app into console app for Win32 Env 5 100
Firemonkey DbLookupComboBox equivalent ? 2 48
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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 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