I randomly get an OLE error 80040E04 whenever I use the QueryAllRecords or QueryCircle method of a dataset. Has anyone else experienced this and is there a reason/solution ?
This is a discussion on OLE error 80040E04 when using QueryAllRecords or QueryCircle within the MapPoint Desktop Discussion forums, part of the Map Forums category; I randomly get an OLE error 80040E04 whenever I use the QueryAllRecords or QueryCircle method of a dataset. Has anyone ...
I randomly get an OLE error 80040E04 whenever I use the QueryAllRecords or QueryCircle method of a dataset. Has anyone else experienced this and is there a reason/solution ?
Hi,
a short time back someone posted this: http://support.microsoft.com/default...b;en-us;299720
Possible same bug occurs in other findresults.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
I recently wrote some new code and started seeing this. Did you happen to find a work around for this problem?
Unfortunately no. The error appears completely randomly, even using the same data, sometimes I get no errors and others times I do get an error - it is very frustrating. I get the impression that either using OLE at all or specifically Mappoint isn't entirely stable
Given that it seems random, I was going to try:
1) do some other queries first and then come back to this one.
2) put a loop around the try/catch for the query and loop until it works
3) #2 but with waiting a small amount of time.
Have you tried any of these with any success?
not as yet - i do plan on trying it x number of times and raising the exception if it fails after this many. If you find this works please let me know.
I was able to get it to work with my testcase (56 separate datasets, each one queried 30 times) by catching the error and then retrying after I had finished processing the other datasets. There were 11 failures, none of which failed on the second query. Here is what is used. I will post again if I find this is not working with other sets of data.
-sthurlock
Code:'for/next - set all locations in skipped_routes to True routes_left_to_process = True Do While routes_left_to_process = True routes_left_to_process = False ' this will be reset in the catch below if there are ' any problems w/Queryallrecords else drop out of while loop For r = 1 To n If skipped_routes(r) = True Then skipped_routes(r) = False ' will be set in the catch if there are problems and it has to be retried. fStreamWriter.WriteLine(" " & MPMap.DataSets(routes(r)).Name & " r = " & r) Try rs = MPMap.DataSets(routes(r)).QueryAllRecords() Catch ex As Exception fStreamWriter.WriteLine("Error occurred: " & ex.Message & " " & ex.ToString) routes_left_to_process = True skipped_routes(r) = True GoTo label_next_r End Try ...etc, etc...
There are currently 1 users browsing this thread. (0 members and 1 guests)