Solved

sql in a net application

Posted on 1998-09-24
4
135 Views
Last Modified: 2010-04-03
I've made a net application and I have a problem when I perform an update on a sql dataset. I'm going to explain an example, if I delete a record of a table, all data in computers refreshes, but if I delete a record of a query, the data in other computers doesn't refreshes although I close and open the query. How can I refresh the data in the
sql of others computers?
0
Comment
Question by:girona
4 Comments
 
LVL 1

Expert Comment

by:EmmDieh
ID: 1340803
What Server do you use ?
Check your transaction isolation (repeatable read).
0
 

Author Comment

by:girona
ID: 1340804
I'm ussing Windows NT to contain the DataBase and run the application
0
 

Expert Comment

by:Mariner080498
ID: 1340805
Do you use COMMIT(POST)  method of the TQuery commponent?
Try.
0
 
LVL 10

Accepted Solution

by:
Jacco earned 50 total points
ID: 1340806
I know the problem. We have found the following solution for the problem:

function RefreshLocate(
        ADataSet : TDataSet;
  const KeyFields : String;
        KeyValues : Variant;
        Options : TLocateOptions) : Boolean;
begin
  with ADataSet do begin
    if not Active then Open;
    if not Locate(KeyFields,KeyValues,Options) then begin
      Close;
      Open;
      Result := Locate(KeyFields,KeyValues,Options);
    end else begin
      dbiForceRecordReread(Handle,ActiveBuffer);
      Result := True;
    end;
  end;
end;

We use this in stead of a locate.

And the following was also necessary:

  with dmDataModule.MainDataBase do begin
    StartTransaction;
    Commit;
  end;

We use the TIBEventAlerter to signal the database client when records are updated. The problem was the the changes were'nt reflected on other workstations. With this code before you try to reread your data you should be OK.

Regards Jacco
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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