Safe Arrays question

Posted on 2004-09-21
Last Modified: 2008-05-29
I am taking xml data from a web service (data is good) and loading it into a dataset.

Here is the code that does that:
 procedure TForm1.GetDataFromWebService(AStrXMLDoc: string);
  XMLTransform1.TransformationFile := 'sites.xtr';
  XMLTransform1.SourceXml := AStrXMLDoc;

  ClientDataSet1.XMLData := XMLTransform1.Data;

For some reason that code is throwing esafearraylockederror-variant or safe array is locked.   I cant find anything about this sucker.   any ideas folks?

Question by:hibbidiji

Expert Comment

ID: 12167254
Try->  var before the parameter
Your sending a pointer and if the origin string destroys, the pointer lose its values
procedure TForm1.GetDataFromWebService(var AStrXMLDoc: string);
  XMLTransform1.TransformationFile := 'sites.xtr';
  XMLTransform1.SourceXml := AStrXMLDoc;

  ClientDataSet1.XMLData := XMLTransform1.Data;

Good luck
// Linus

Accepted Solution

jcoman777 earned 500 total points
ID: 12173398
It is caused by a corrupt midas.dll.   I also found answers in google groups that showed this fixed this error for other people as well.  
First: startmenu->run->regsvr32 /u "c:\windows\system32\midas.dll"
Then: Update your midas.dll in c:\windows\system32 (for XP, other windows versions vary) and startmenu->run->regsvr32 "c:\windows\system32\midas.dll"

Author Comment

ID: 12173668
thank god! that totally did it!

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 106
Internet Explorer View Settings Question 15 105
Delphi inherited method 6 61
Dynamically Created Query 3 50
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now