Solved

Safe Arrays question

Posted on 2004-09-21
3
491 Views
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);
begin
  XMLTransform1.TransformationFile := 'sites.xtr';
  XMLTransform1.SourceXml := AStrXMLDoc;

  ClientDataSet1.XMLData := XMLTransform1.Data;
end;



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

Andrew
0
Comment
Question by:hibbidiji
3 Comments
 

Expert Comment

by:linus66
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);
begin
  XMLTransform1.TransformationFile := 'sites.xtr';
  XMLTransform1.SourceXml := AStrXMLDoc;

  ClientDataSet1.XMLData := XMLTransform1.Data;
end;

Good luck
// Linus
0
 
LVL 1

Accepted Solution

by:
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"
0
 
LVL 1

Author Comment

by:hibbidiji
ID: 12173668
thank god! that totally did it!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 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