Solved

Paradox table not refreshing

Posted on 2003-11-10
2
213 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now