<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Update datasources for layers in an MXD in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435766#M11793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Possible solutions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Reference the data using a UNC path.&amp;nbsp; For example, \\machine\share\file.extension.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Put the data in a path which is not based on Program Files.&amp;nbsp; Why not use C:\Assessor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Use symbolic links to make the paths the same, e.g. using junction or mklink.&amp;nbsp; If you do this then you can install the data to different locations but reference it using the same symbolic (or logical) link&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jan 2011 00:56:10 GMT</pubDate>
    <dc:creator>RichardWatson</dc:creator>
    <dc:date>2011-01-25T00:56:10Z</dc:date>
    <item>
      <title>Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435765#M11792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My environment...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Windows 7 32-bit (and 64-bit as you'll see later)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Visual Studio 2008&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Visual Basic.NET&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; ArcObjects 9.3 (and Service Pack if any)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the quickest, easiest way to understand what I am asking, please see the attached picture and follow along as I reference the pic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, there are 2 highlighted items. My issue comes about as a result of trying to use this MXD on a Windows 7 64-bit system. It works fine on Windows 7 32-bit because the paths are correct, however, on a Windows 7 64-bit system, Microsoft decided to completely screw up their paths causing much heartache to millions of developers migrating to Windows 7 64-bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On a Windows 7 32-bit system...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The parcel layer's datasource per the picture is...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\Assessor\Common\GIS\weeklyparcel.gdb&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Several other layer's datasources per the picture are...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C:\Program Files\Assessor\Common\GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, on a Windows 7 64-bit system...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; The parcel layer's datasource is actually located here...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; C:\Program Files &lt;/SPAN&gt;&lt;STRONG&gt;(x86)&lt;/STRONG&gt;&lt;SPAN&gt;\Assessor\Common\GIS\weeklyparcel.gdb&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Several other layer's datasources are actually located here...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; C:\Program Files &lt;/SPAN&gt;&lt;STRONG&gt;(x86)&lt;/STRONG&gt;&lt;SPAN&gt;\Assessor\Common\GIS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to be able to simply update these paths as needed. I have code that tells me whether I am on a 32-bit O.S. or a 64-bit O.S. but I have no idea how to update these datasources through ArcObjects .NET code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So that's my question... how do I update these paths on-the-fly using ArcObjects .NET, so that I don't have to have one MXD for 64-bit version of Windows, and another MXD for the 32-bit version of Windows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2011 23:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435765#M11792</guid>
      <dc:creator>ESRICustomer</dc:creator>
      <dc:date>2011-01-24T23:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435766#M11793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Possible solutions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Reference the data using a UNC path.&amp;nbsp; For example, \\machine\share\file.extension.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Put the data in a path which is not based on Program Files.&amp;nbsp; Why not use C:\Assessor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Use symbolic links to make the paths the same, e.g. using junction or mklink.&amp;nbsp; If you do this then you can install the data to different locations but reference it using the same symbolic (or logical) link&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 00:56:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435766#M11793</guid>
      <dc:creator>RichardWatson</dc:creator>
      <dc:date>2011-01-25T00:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435767#M11794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Possible solutions:&lt;BR /&gt;&lt;BR /&gt;1) Reference the data using a UNC path.&amp;nbsp; For example, \\machine\share\file.extension.&lt;BR /&gt;2) Put the data in a path which is not based on Program Files.&amp;nbsp; Why not use C:\Assessor?&lt;BR /&gt;3) Use symbolic links to make the paths the same, e.g. using junction or mklink.&amp;nbsp; If you do this then you can install the data to different locations but reference it using the same symbolic (or logical) link&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Because we have tons of apps that are already dependent on C:\Program Files\... it's not practical at this point to change it, so (1) and (2) aren't feasible.&amp;nbsp; I'm not sure how (3) works, but I'll take a look at that.&amp;nbsp; I'd still like to know how to update the datasources through code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 14:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435767#M11794</guid>
      <dc:creator>ESRICustomer</dc:creator>
      <dc:date>2011-01-25T14:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435768#M11795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There are classes in the .NET Framework for handling this sort of thing.&amp;nbsp; Because the location of system and special Windows folders differs from OS to OS, you should use these built-in classes when dealing with the file system.&amp;nbsp; The location of the Program Files folder can be determined in Visual Basic with the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim programFilesPath As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can then append any subdirectory paths and/or filenames as needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 16:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435768#M11795</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-01-25T16:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435769#M11796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There are classes in the .NET Framework for handling this sort of thing.&amp;nbsp; Because the location of system and special Windows folders differs from OS to OS, you should use these built-in classes when dealing with the file system.&amp;nbsp; The location of the Program Files folder can be determined in Visual Basic with the following code:&lt;BR /&gt;&lt;BR /&gt;Dim programFilesPath As String = My.Computer.FileSystem.SpecialDirectories.ProgramFiles&lt;BR /&gt;&lt;BR /&gt;You can then append any subdirectory paths and/or filenames as needed.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Everyone seems to be missing the point.&amp;nbsp; It really doesn't matter where the MXD itself is stored.&amp;nbsp; The problem is the paths stored inside the MXD itself (or the shape files or whereever that path is stored) are pointing to the wrong location.&amp;nbsp; Back to my original question, I need to know how to update the paths that are shown in the attached image.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 17:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435769#M11796</guid>
      <dc:creator>ESRICustomer</dc:creator>
      <dc:date>2011-01-25T17:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update datasources for layers in an MXD</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435770#M11797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is a link that should get you started, you'll probably need to change the type of workspaceFactory:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=992&amp;amp;t=107064"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=992&amp;amp;t=107064&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 17:30:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/update-datasources-for-layers-in-an-mxd/m-p/435770#M11797</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2011-01-25T17:30:49Z</dc:date>
    </item>
  </channel>
</rss>

