tags:

views:

127

answers:

3

Hi,

Over the last few days we have seen random access violations being raised on Delphi 2006 using the ClientDataSet when loading an XML block but the errors disappear when using CodeGear 2007 rad Studio.

I have a strange feeling that this is going to come back and haunt us in the future.

So, how can I debug the xml load procedure for a clientdataset.LoadFromStream method?

I can see it is defined in dbclient.pas but I cannot seem to find the xml processing section.

JD

A: 

it been a while since ive been on 2006 but if i remember right

turn on debug packages then you should just be able to step into it

Jonathan D
Hi, I have debug dcus checked and no runtime packages built with the exe. I can step into DbClient.pas but I cannot seem to find where the xml loading is taking place.
JD
It's happening in Midas.dll, which as others have said you don't get the source code for until Delphi 2010 (and then, I think, only with certain SKUs). Since you can't trace into Midas.dll without the source, and you don't have the source available, you can't debug the XML loading code.
Ken White
A: 

As far as I know the LoadFromStream cannot be used to load XML files, the data in the stream should be in the internal format used by the client dataset. Try setting the XMLData property instead.

Tihauan
Sorry, this is what I meant. I am trying to find where the internal format is loaded so that I can debug.
JD
+5  A: 

I don't know if you've tried this already, but it's entirely legal (and supported) to use the Delphi 2007 version of midas.dll with a Delphi 2006 application. Since Embarcadero did fix some DataSnap bugs in Delphi 2007, there is some possibility that the errors you are seeing are caused by a Delphi 2006 bug. It is worth a try to substitute the 2007 version of midas.dll with your Delphi 2006 application and see if the errors go away. It might not fix the problem, but it will save you a lot of trouble and frustration if it does.

Craig Stuntz
Thanks Craig for the info. When we ship the product we do not ship with the midas.dll. I was curious how we could debug the clientdataset (for future reference).
JD
Well, you can debug through DBClient.pas, as others have suggested. But most of ClientDataSet *is* midas.dll. The only way to debug *that* is to get D2010, which includes its (C++!) source code or to use a disassembler.
Craig Stuntz
If we do not distribute the midas.dll, does delphi just link in the necessary code into the exe?
JD
@JD, it does if you use MidasLib.dcu. However, you're stuck with the D2006 implementation if you do this.
Craig Stuntz
Thanks for all the help.
JD