MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Access Denied Error on DisplayDataMap

This is a discussion on Access Denied Error on DisplayDataMap within the Development forums, part of the MapPoint 2006/2009 Discussion category; I am creating maps using Excel macros. When processing encounters the following code: Set objDataMap = _ objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  7 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-15-2008
Junior Member
White Belt
 
Join Date: Jan 2008
Posts: 10
Question Access Denied Error on DisplayDataMap

I am creating maps using Excel macros. When processing encounters the following code:


Set objDataMap = _
objDataSet.DisplayDataMap(geoDataMapTypeShadedArea , objField, _
geoShowByRegion2, geoCombineByDefault, _
geoRangeTypeUniqueValues, geoRangeOrderDefault, 15)

It errors with the following error text:

Runtime Error: '-2147024891 (800700005)': Access Denied

When the same code runs for a map that shows quintiled counties no problem. But when it runs for a map showing seed territories...BLAM!!...huge error.

This is driving me nuts...I cannot find any info about the error anywhere.

Any help is appreciated.
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-15-2008
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,318
Blog Entries: 1
Re: Access Denied Error on DisplayDataMap

Can you post the ptm map files?

DisplayDataMap is a pain, I would try doing the simplest map first and then add parameters one at a time - you can see if it is just one of the parameters that is making it bomb.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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-16-2008
Junior Member
White Belt
 
Join Date: Jan 2008
Posts: 10
Re: Access Denied Error on DisplayDataMap

Eric,

I tried to post a PTM file and could not do it. I was using the manage attachments tool in the reply to thread application. Is there another way?

Thanks,

Tbird
Attached Files
File Type: zip A4722.zip (105.5 KB, 4 views)
File Type: zip A4722B.zip (21.1 KB, 2 views)
File Type: zip A4722C.zip (18.1 KB, 2 views)
File Type: zip A4722D.zip (24.6 KB, 2 views)
File Type: zip A4722E.zip (14.6 KB, 2 views)

Last edited by Eric Frost; 01-16-2008 at 10:41 AM.
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 01-16-2008
Junior Member
White Belt
 
Join Date: Jan 2008
Posts: 10
Re: Access Denied Error on DisplayDataMap

Thanks for the help with posting the files. I do not have zip software on my computer at work as we are pretty limited to what we get as far as software is concerned. Here is some code that might help:
Code:
 
Public Sub GenerateTerritory_Data_Map(strBook As String, strSheet As String, strContext As String)

    Dim strLegendTitle As String

    DataPath = Left(AbsPath, InStrRev(AbsPath, "\") - 1)
    DataFile = DataPath & "\" & strBook & "!" & strSheet

    If Not UCase(strContext) Like "*TERRITORY*" And Not LCase(TableName) Like "*datamap*" Then
        Set objDataSet = objMap.DataSets.ImportTerritories(DataFile, aFields, geoCountryUnitedStates, , geoImportExcelSheet)
    Else
        Set objDataSet = objMap.DataSets.ImportData(DataFile, aFields, geoCountryUnitedStates, , geoImportExcelSheet)


        If InStr(strContext, "bu") > 0 Then
            Set objField = objDataSet.Fields("business unit")
            strLegendTitle = "Business Units"
        ElseIf InStr(strContext, "district") > 0 Then
            If InStr(strContext, "datamap") > 0 Then
                Set objField = objDataSet.Fields("Quintile Label")
                strLegendTitle = "Quintiled Counties"
            Else
                Set objField = objDataSet.Fields("dist desc")
                strLegendTitle = "Districts"
            End If

        ElseIf InStr(strContext, "territory") > 0 Then
            If InStr(strContext, "datamap") > 0 Then
                Set objField = objDataSet.Fields("Quintile Label")
                strLegendTitle = "Quintiled Counties"
            End If
        Else
                Set objField = objDataSet.Fields("terr desc")
                strLegendTitle = "Territories"
        End If

        Set objDataMap = objDataSet.DisplayDataMap(geoDataMapTypeShadedArea, objField, _
                       , geoCombineByDefault, geoRangeTypeUniqueValues, geoRangeOrderDefault, 15)
    End If


    MsgBox "Order of data ranges in data map: " & _
      objDataMap.DataRanges.DataRangeOrder


    If Not UCase(strContext) Like "*TERRITORY*" Or LCase(TableName) Like "*datamap*" Then

        objDataMap.LegendTitle = strLegendTitle
    End If

      objMap.MapStyle = geoMapStyleData
'    If strLegendTitle = "Quintiled Counties" Then
'        objDataSet.ZoomTo
'    End If
'
        ' If the level is under national, zoom in
    If Not UCase(strContext) Like "*NATIONAL*" Then
        ResizeMap
        'objDataSet.ZoomTo
    End If

        ' Set the territory labels
    If UCase(strContext) Like "*TERRITORY*" And Not LCase(TableName) Like "*datamap*" Then
        objDataMap.LegendTitle = strLegendTitle
        AddTerritoryLabel strContext
    End If

End Sub
In this instance the strContext looks like this:
hierarchy_national_seed for the first tab in excel spreadsheet
hierarchy_district_seed for the next 1 to 4 tabs
hierarchy_territory_seed for the rest of the tabs

Thanks
Tbird

Last edited by Paul Larson; 01-21-2008 at 07:43 AM. Reason: insert CODE block, remove HTML formatting for legibility
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 01-16-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 219
Re: Access Denied Error on DisplayDataMap

TBird,

I was able to dowload your zips.
Could you post the XLS also?
(There's some stuff missing from your posted code)

Mike Mattys
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 01-18-2008
Senior Member
Blue Belt
 
Join Date: Dec 2002
Posts: 219
Re: Access Denied Error on DisplayDataMap

TBird,

My email is: mmattys at rochester.rr.com
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/access-denied-error-displaydatamap-7006.html

Posted By For Type Date
MapPoint CD, MapPoint Web Service, Virtual Earth, and other Mapping Solutions - MSDN Forums This thread Refback 01-30-2008 02:14 AM
Virtual Earth December Updates - MapPoint News - MP2K Magazine This thread Refback 01-16-2008 10:31 AM
About MP2Kmag - MP2K Magazine This thread Refback 01-16-2008 04:13 AM
About MP2Kmag - MP2K Magazine This thread Refback 01-16-2008 04:13 AM
Author - MP2K Magazine This thread Refback 01-16-2008 04:13 AM
About MP2Kmag - MP2K Magazine This thread Refback 01-16-2008 04:13 AM
The Magazine for MapPoint - MP2K Magazine This thread Refback 01-15-2008 01:56 PM

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
Access denied trying to set waypoint.preferredarrival stephenmillington MapPoint 2006/2009 Discussion 2 07-14-2008 01:46 PM
Mappoint access denied error rskrzydlo MapPoint 2006/2009 Discussion 7 01-29-2007 10:29 PM
Access denied using 'PreferredDeparture' denjoyner MapPoint 2006/2009 Discussion 0 06-16-2005 10:27 AM
MapPoint: Error - Access Denied Anonymous MapPoint 2006/2009 Discussion 0 01-17-2005 07:34 AM
access denied: Interop Anonymous MapPoint 2006/2009 Discussion 0 06-28-2003 03:22 AM


All times are GMT -5. The time now is 01:06 AM.


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

Ski Chalet
Fancy a ski chalet? Relax in comfort and style between skiing sessions. Holiday Hypermarket makes it easy for you to specify what kind of accommodation you want.

Cyprus Weather
Check out Cyprus Weather - Travel Counsellors details information on Cyprus including, weather, flights and accommodation.

Cuba Holiday
A Cuba Holiday has so much to offer with numerous different cultures affecting the sights, sounds and tastes. Visit this fascinating country with dealchecker.co.uk.

Bahamas Holidays
Bahamas Holidays offer pure blue skies, soft white beaches and the holiday of a lifetime. Visit us for a great deal to the Bahamas.

Cheap Cyprus Holidays
Finding cheap Cyprus holidays can be difficult unless you know where to look and where to book. With ulookubook.com you can conduct a simple search to find the latest holiday deals to your particular destination.

Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk

Holidays in Cyprus
Visit the tombs of the island kings! Visit On The Beach for information on holidays in Cyprus.


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