-1

I have a datasnap server app developed originally with XE5 that was working fine with a client app on a mobile tablet accessing a Firebird database on a server. I have recompiled the code with XE7. The only change I had to make to the code to compile without any errors was to add DataSnap.DSProviderDataModuleAdapter to the uses of the methods unit. Have replaced the server app on the server (stop service/uninstall/reinstall/start service) and now I can no longer insert/update records in the database on the server. Whenever I reach the line of code to ApplyUpdates(0) I get the following error:

Remote Error: Access violation at address 0093CB3F in module Snackerservice.exe. Read of address 00000000.

Retrieving data from the database to display on the tablet is not a problem so the connection is working.

If I change the server app back to the one developed under XE5......all works fine again. The other strange thing is that there are no problems with the XE7 compiled app when using 'localhost' to access a copy of the database on my development machine......only when accessing through an IP connection to a server.

Can someone please help me solve this frustrating problem.

Bill Zwirs

To hopefully make it a little clearer, here is a bit of code that causes the issue:

iLic := ServerMethodsClient.Get_Licences;
iDev := ServerMethodsClient.Get_NumDevices;
if (iDev < iLic) then
begin
  iDevID := ServerMethodsClient.Get_NewDevID;
  MobClientDM.DevicesClient.Open;
  MobClientDM.DevicesClient.Insert;
  MobClientDM.DevicesClientDEVID.AsInteger:= iDevID;
  MobClientDM.DevicesClientMACADDRESS.AsString := sMacAddress;
  MobClientDM.DevicesClient.Post;
  if (MobClientDM.DevicesClient.ChangeCount > 0) then
    MobClientDM.DevicesClient.ApplyUpdates(0);         ....................Error occurs here
end;
Danilo Casa
  • 506
  • 1
  • 9
  • 18
Bill Zwirs
  • 21
  • 4
  • 1
    Verify that the Dataset exists when calling .ApplyUpdates(0) If the Dataset variable is nil it could result in this error. Another if you can reproduce under the debugger it would be good to look at the call stack as that might give you a clue. – Robert Love Jan 15 '15 at 22:23
  • Not sure how to verify if dataset exists. I have added some example code to show where the problem occurs. When trying to insert a record the ChangeCount value = 1 (when I check in debugger mode).....so does this verify that the dataset exists. – Bill Zwirs Jan 16 '15 at 02:19

1 Answers1

2

Problem solved at last.

When I installed the server app on the server I also added Midas.dll to the directory which worked fine until I compiled with XE7. So I have now included MidasLib in the uses clause of the server app and removed the Midas.dll file from the install directory. Compiled and installed and all works good again.

Hope this helps others who might have a similar problem.

Bill Zwirs

Bill Zwirs
  • 21
  • 4