?
Solved

Delphi Datasnap ADO Refresh problems

Posted on 2003-02-24
7
Medium Priority
?
1,826 Views
Last Modified: 2013-11-23

Hi,

I am creating a multi-tier database application using DCOM Remote datamodules.

The server-tier connects to a MS SQL database using ADO Connections; A number of ADOQueries and ADOTables are present, which are all exported by DataSetProvider components.

The client-tier connects to the remote data module using a DCOMConnection. All by the Server's Remote Datamodule exported DataSets are imported by CliendDataSet components.


And here is the problem:

When a client is running, and I change a record in the database by hand, the ClientDataSet components connecting to ADOQueries do refresh correctly when I call Refresh().

However, the ClientDataSets components connecting to the ADOTables DO NOT refresh correctly when I call Refresh(). Even Close() followed by Open() do not result in the correct recordset. The only way to fetch the correct recordset was to open and close the DCOMConnection....that is not the way it is supposed to work, is it?

The Borland FAQ says you should get to see changes made by other users when you apply updates:

ClientDataSet1.ApplyUpdates(-1);
ClientDataSet1.Refresh();

Apparently, this does not work (At least not in my scenario). It seems like the server denies to send a new recordset to the client when a Refresh is called....

I suspect the CursorType property of the TADOTable on the server has something to do with it. If I correctly understand the help section, it should be set to 'ctDynamic' instead of 'ctKeyset'. However, ctDynamic is only effective when CursorLocation is set to clUseServer instead of (the default) clUseClient.

Can anybody help me out?
0
Comment
Question by:MaximumCarnage
[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
  • 3
  • 3
7 Comments
 

Expert Comment

by:miroslavp
ID: 8008265
Hi,

Why you use TADOTable components? Use TADOQuery! You can read anywhere in the Borland's help that TxxxTable (TADOTable, TTable, TIBTable) components are mainly designed for desktop applications.

TIA,
Miro.
0
 

Expert Comment

by:mick3y
ID: 8010430
Ok, you have a client-server application and your databse is on the server, correct? If so, try using TRANSACTIONS. See delphi help, there is one example that pictures your situation and if that does not work, try to figure how are you using the file "Pdoxusrs.net". This file is the one that carries all the data changes of your database, you must SUBMIT the changes.
0
 

Expert Comment

by:miroslavp
ID: 8014667
Hi,

Conversation is about MS SQL Server and ADO. What "pdoxusrs.net"?!? There is nothing about Paradox or BDE.

TIA,
Miro.
0
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!

 

Author Comment

by:MaximumCarnage
ID: 8014939

OK, using TADOQuery components instead of TADOTable is possible (I tried it for a moment before posting this question), but then other issues arise when updating a record by means of a ClientDataSet:

Exceptions are thrown that mention "Bookmark not found" or "No index specified".

Are there any specific points I forgot about? (I'm using data bound controls to insert / update a record).

0
 

Author Comment

by:MaximumCarnage
ID: 8015103

OK, using TADOQuery components instead of TADOTable is possible (I tried it for a moment before posting this question), but then other issues arise when updating a record by means of a ClientDataSet:

Exceptions are thrown that mention "Bookmark not found" or "No index specified".

Are there any specific points I forgot about? (I'm using data bound controls to insert / update a record).

0
 

Accepted Solution

by:
miroslavp earned 300 total points
ID: 8015174
Hi,

There are many issues about ADOExpress in Delphi. Some of problems come from not quite good realization of ADOExpress components (I heard many good words about TBetterADODataSet, where author has fixed many issues), but the most problems come from MS ADO itself :(, especially in updates. I have very much problems and in most of cases there is no any “recipe” for problems in ADOExpress and MS ADO.
I have applications similar to your (except that I use IBX and Interbase) and I tell to my DataSet provider to apply updates directly to database (to skip the underlying DataSet component – in your case TADOQuery).
How you make updates? Are you trying directly updates? (I am not sure that they are applicable to ADOExpress).

TIA,
Miro.
0
 

Author Comment

by:MaximumCarnage
ID: 8021035


Well, so far it works but I am sure I will encounter some problems :)

Untill then, thanks and I get back to you.
0

Featured Post

Independent Software Vendors: 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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

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