Solved

Paradox table not refreshing

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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML text in the body of an email (delphi code) 12 211
Magic Software info 18 144
creating threads in delphi 1 163
How to create virtual printer while installing my application 5 69
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…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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