PDA

View Full Version : OLE error 80040E04 when using QueryAllRecords or QueryCircle



stephenmillington
10-31-2005, 08:50 AM
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 ?

Wilfried
11-02-2005, 07:51 AM
Hi,

a short time back someone posted this: http://support.microsoft.com/default.aspx?scid=kb;en-us;299720

Possible same bug occurs in other findresults.

sthurlock
12-06-2005, 10:22 PM
I recently wrote some new code and started seeing this. Did you happen to find a work around for this problem?

stephenmillington
12-07-2005, 03:12 AM
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

sthurlock
12-07-2005, 07:01 AM
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?

stephenmillington
12-07-2005, 07:42 AM
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.

sthurlock
12-08-2005, 07:04 AM
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



'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...