Delphi Datasnap ADO Refresh problems
Posted on 2003-02-24
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:
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?