MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Getting "unspecified error" in VB during FindAddre

This is a discussion on Getting "unspecified error" in VB during FindAddre within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have a VB app that accesses the current Map object, and uses the following code... Set oFR = oMap.FindAddressResults(Address1, ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2003
Junior Member
White Belt
 
Join Date: Aug 2003
Posts: 9
Getting "unspecified error" in VB during FindAddre

I have a VB app that accesses the current Map object, and uses the following code...

Set oFR = oMap.FindAddressResults(Address1, City, ,ST, Zip, geoCountryUnitedStates)
followed by
If oFR.ResultsQuality < geoNoGoodResult Then...

if Address1 includes the string "po box" then I get a VB application error (0x80004005) 'Unspecified error"

I would have thought that if the FindAddressResults() fails, it would set oFR to nothing, OR the ResultsQuality would be geoNoGoodResult or higher. Unforunately, I'm never able to get this far.

Any ideas?

TIA,
Mike
__________________
Mike Schoonmaker
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-27-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
PO box

I ran into the same problem. In the MP reference there are some guidelines. I had to add a filter to remove these items. I still think it is pretty bad that an unhandled exception is thrown.

Here are the rules:

Address coverage in MapPoint is available for all of the United States and major urban areas in Canada.

Type as much of the address as possible. Adding the ZIP or postal code is especially helpful.

Do not include apartment, suite, post office (P.O.) box numbers, or rural route (R.R.) addresses in the street address.

Do not include fractions. For example, if the address is 654 1/2 Carlson Street, type 654 Carlson Street.

If you are not sure of the correct spelling of a street or city name, type the closest approximation you can to view a list of possible choices, and then click the best match in the list.

If a street name includes an ampersand (&), replace the ampersand with the word "and." (Ampersands are used to denote intersections.)

If you cannot find an address that includes an abbreviation, try spelling it out. For example, try Saint James if "St. James" is not recognized.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-27-2004
Junior Member
White Belt
 
Join Date: Aug 2003
Posts: 9
RE: Getting "unspecified error" in VB during FindA

The address being used should not be a problem. I'm running the addresses through some USPS CASS-certified software for Address Correction before running in MapPoint.

Thanks for your suggestions.
__________________
Mike Schoonmaker
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 05-24-2006
citrix_99301's Avatar
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 12
MapPoint.Application.NA.13 Unspecified error

I'm pretty sure it's not the address; I'm getting the same kind of unspecified error when querying a dataset / pushpin set using MapPoint.Recordset oRSR = oDS.QueryAllRecords(). I've a growing suspicion that this is a stack overflow issue within the axMapPoint object itself.

My application is a route optimization tool for a large lawn and tree care company. Our routing department might pull up a week's worth of work for ten mowing routes; this might create 300 or so pushpins on the map. There's a treeview control on the windows form that displays each route as a node with the route's jobs as subnodes. When the user clicks on an item in the treeview, that route or job' pushpin(s) is higlighted on the axMapPoint map. After clicking on a few of these, the axMapPoint map invariably starts kicking out "Unspeciied Error" messages and won't respond anymore.

I've double checked all the addresses and they all meet the criteria mentioned in the previous post. Furthermore, the failure appears to be random and based on the number of times a user clicks to the map rather than on a specific address. The more pushpins on the map, the fewer routes/jobs I have to click on before it fails. I've gotten it to fail with as few as 60 pushpins but have to click around for quite a while before it ails. However, with 350 pushpins the "unspecified error" failure is guaranteed after just a few clicks. The failure point is at oDS.QueryAllRecords(); the pushpin set has the correct number of matching records but throws the exception once it keeps working.

The fact that the failure point happens on different addresses each time (an address may work the first time but fail if I click it again) and the failure point comes sooner the more pushpins are on the map leads me to believe that after a while a memory stack in MapPoint 2006 is overflowing.


Thanks,

Andre Ranieri



private void tvRoutes_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
{
if (!this.bIsBuilding) // suppress if building a new map. this is set in another method
{
try
{


/// TOD: this loop is here for debugging: delete all pushpinsets w/ no pushpins
foreach (MapPoint.DataSet ddd in axMapPoint.ActiveMap.DataSets)
{
Console.WriteLine(ddd.Name + '\t' + ddd.RecordCount);
if (ddd.RecordCount == 0)
ddd.Delete();
}


MapPoint.Map oMap = this.axMapPoint.ActiveMap;

datDateSched = DateTime.Now;
iServiceID = 0;
this.sPrintDate = dtStart.Value.ToShortDateString() + " to " + dtEnd.Value.ToShortDateString();

//remove highlighting on all pushpins
foreach (TreeNode n in tvRoutes.Nodes)
{
if (n.Parent == null)
{
datDateSched = ((Senske.SenskePro.Accounts.myTechNode)(((System.W indows.Forms.TreeNode)((n))))).datDateScheduled;
sNodeRoute = ((Senske.SenskePro.Accounts.myTechNode)(((System.W indows.Forms.TreeNode)((n))))).sRoute;
Object oName = (object)sNodeRoute + "-" + datDateSched.ToShortDateString();

if (oName == null)
{
return;
}
MapPoint.DataSet oDS = oMap.DataSets.get_Item(ref oName);
if (oDS.RecordCount >= 1)
{
MapPoint.Recordset oRSR = oDS.QueryAllRecords(); // Sometimes generates "Unspecified Error" here

oRSR.MoveFirst();
if (oRSR.EOF)
{
return;
}

oRSR.MoveFirst();
if (oRSR.EOF)
{
return;
}
while (!oRSR.EOF)
{
//MapPoint.Pushpin pin = oRS.MoveToPushpin();
// pin.Highlight = true;

oRSR.Pushpin.Highlight = false;
oRSR.MoveNext();
}
oRSR = null; //clear recordset
}
}
}


// this is a top-level route node
if (tvRoutes.SelectedNode.Parent == null)
{
sNodeType = "TechNode";
datDateSched = ((Senske.SenskePro.Accounts.myTechNode)(((System.W indows.Forms.TreeNode)((tvRoutes.SelectedNode))))) .datDateScheduled;
sNodeRoute = ((Senske.SenskePro.Accounts.myTechNode)(((System.W indows.Forms.TreeNode)((tvRoutes.SelectedNode))))) .sRoute;

MapPoint.DataSet oDS;
Object oName = (object)sNodeRoute + "-" + datDateSched.ToShortDateString();
oDS = oMap.DataSets.get_Item(ref oName);

if (oDS.RecordCount >= 1)
{
MapPoint.Recordset oRS = oDS.QueryAllRecords();
oRS.MoveFirst();
if (oRS.EOF)
{
return;
}
while (!oRS.EOF)
{
//MapPoint.Pushpin pin = oRS.MoveToPushpin();
// pin.Highlight = true;

oRS.Pushpin.Highlight = true;

oRS.MoveNext();
}
oDS.ZoomTo();
oRS = null; //clear recordset
this.sPrintDate = " for " + datDateSched.ToShortDateString();
}
}

// this is a second-level job node
else
{
sNodeType = "JobNode";
datDateSched = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). datDateScheduled;
iServiceID = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). iServiceID;
iAccountKey = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). iAccountKey;
sBName = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). sBName;
sSAddress = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). sSAdress;
sPrenotifyStatus = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). sPrenotifyStatus;
sServiceOn = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). sServiceOn;
sNodeRoute = ((Senske.SenskePro.Accounts.myJobNode)(((System.Wi ndows.Forms.TreeNode)((tvRoutes.SelectedNode))))). sRoute;



if (oMap.FindPushpin(iServiceID.ToString()) != null)
{
oMap.FindPushpin(iServiceID.ToString()).Highlight = true;
oMap.FindPushpin(iServiceID.ToString()).GoTo();
}
}
oMap.Saved = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "An error has occured at " + ex.Source ,MessageBoxButtons.OK, MessageBoxIcon.Error);
Class1 cls1 = new Class1();
cls1.SendError(this.ToString(), ex, "Route: " + this.cboRoute.Text + "\r\nNode: " + datDateSched.ToShortDateString());
return;
}
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-25-2006
citrix_99301's Avatar
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 12
"Unspecified Error" - problem solved

I just thought I'd post my solution to the "unspecified error" issue.

I ended up setting the oName object to null at the end of the method and the symptoms went away.

I didn't realize the object was being passed into Map Point itself; I'd incorectly assumed that they would be deallocated when the method completed and the object passed out of scope.


Cheers,

Andre Ranieri
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-12-2006
citrix_99301's Avatar
Junior Member
Yellow Belt
 
Join Date: Mar 2006
Posts: 12
Unspecified Error - MapPoint 2006 Active-X from VS .NET 2003

A followup to my earlier post: It appears the unspecified error is some type of memory leak / buffer overflow coming from MapPoint itself. The users can query so many recordsets from the map's pushping sets before MapPoint bombs.

Apprently, when the axMapPoint map object is dumped to a .ptm file (.saveas method) the buffers are cleared. I'll never know how I stumbled upon this. My really, really ugly workaround to the issue is to save the map to a file every time the pushpin selection changes on the map. Occasionally the file has an exclusive lock on it after being saved, which is only released when MapPoint is closed. This is the reason for the try / empty catch block and random number concatenated into the file name.

The dispose method of the form attempts to delete the temp directory.

Again, this is ugly but appears to solve the unspecified error bug.

Andre Ranieri


string sRnd = rGen.Next(1,1000).ToString();

//create temp directory to "dump" mappoint maps

if(!Directory.Exists(@"C:\Temp\" + Class1.sLogin + @"\MapPoint\"))
{
Directory.CreateDirectory(@"C:\Temp\" + Class1.sLogin + @"\MapPoint\");
}
try
{
this.axMapPoint.SaveMapAs(@"C:\Temp\" + Class1.sLogin + @"\MapPoint\BestFit" + sRnd+ ".ptm");
}
catch
{

}
oMap.Saved = true;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
findaddre, unspecified error


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Error in calling "get_streetAddress" dgaranz MapPoint 2006/2009 Discussion 5 06-23-2006 06:03 AM
MapPoint OLE error: "Could not update object" wiecho_k MapPoint 2006/2009 Discussion 1 07-23-2005 11:53 AM
Error "overflow execution stack" while readinq a Anonymous MapPoint 2006/2009 Discussion 5 02-18-2005 02:47 PM
Do I need "Autoroute Europe", if I install "M bigtail MapPoint 2006/2009 Discussion 1 03-24-2004 12:58 AM
error 16398 with NT service "localsystem" arsenic77 MapPoint 2006/2009 Discussion 3 06-19-2003 11:37 AM


All times are GMT -5. The time now is 09:05 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55