# Use a UNC path with WorldMapKit?

**URL:** <https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474>\
**Category:** World Map Kit\
**Created:** [October 28, 2015, 9:50am UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474 "2015-10-28T09:50:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@Jay](https://community.thinkgeo.com/u/Jay)\
**Post date:** [October 28, 2015, 9:50am UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474/1 "2015-10-28T09:50:04Z")

</div>

Is&nbsp;it&nbsp;possible&nbsp;to&nbsp;use&nbsp;a&nbsp;UNC&nbsp;path&nbsp;for&nbsp;the&nbsp;sqlite&nbsp;file?&nbsp;I’m&nbsp;doing&nbsp;the&nbsp;following&nbsp;(btw,&nbsp;the&nbsp;code&nbsp;formatter&nbsp;doesn’t&nbsp;seem&nbsp;to&nbsp;be&nbsp;working):&nbsp;  
  
  
  
OsmWorldMapKitLayer&nbsp;osmWorldMapKitLayer&nbsp;=&nbsp;new&nbsp;OsmWorldMapKitLayer(“Data&nbsp;Source=\\server\share\WorldMapKit.sqlite;Version=3;Read&nbsp;Only=True;”,&nbsp;OsmWorldMapKitDatabaseType.Sqlite);  
  
and&nbsp;I&nbsp;get&nbsp;an&nbsp;error&nbsp;in&nbsp;the&nbsp;map&nbsp;background&nbsp;which&nbsp;says&nbsp;“unable&nbsp;to&nbsp;open&nbsp;database&nbsp;file”.&nbsp;I&nbsp;did&nbsp;find&nbsp;this  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[sqlite.1065341.n5.nabble.com/System-Data-SQLite-and-UNC-Paths-td72920.html](http://sqlite.1065341.n5.nabble.com/System-Data-SQLite-and-UNC-Paths-td72920.html)  
so&nbsp;I&nbsp;tried&nbsp;it&nbsp;with&nbsp;eight&nbsp;backslashes&nbsp;(i.e.&nbsp;four&nbsp;escaped&nbsp;backslashes)&nbsp;with&nbsp;the&nbsp;same&nbsp;result.&nbsp;If&nbsp;I&nbsp;map&nbsp;the&nbsp;share&nbsp;to&nbsp;a&nbsp;drive,&nbsp;it&nbsp;works&nbsp;just&nbsp;fine.&nbsp;However,&nbsp;that’s&nbsp;not&nbsp;necessarily&nbsp;an&nbsp;option&nbsp;for&nbsp;me&nbsp;on&nbsp;our&nbsp;production&nbsp;box…

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [October 29, 2015, 6:16am UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474/2 "2015-10-29T06:16:09Z")

</div>

Hi&nbsp;Jay,&nbsp;  
  
  
  
Please&nbsp;try&nbsp;following:&nbsp;

> `OsmWorldMapKitLayer osmWorldMapKitLayer = new OsmWorldMapKitLayer("Data Source=\\\\server\share\WorldMapKit.sqlite;Version=3;Read Only=True;", OsmWorldMapKitDatabaseType.Sqlite);`

  
Or&nbsp;  
  

> `OsmWorldMapKitLayer osmWorldMapKitLayer = new OsmWorldMapKitLayer(@"Data Source=\\server\share\WorldMapKit.sqlite;Version=3;Read Only=True;", OsmWorldMapKitDatabaseType.Sqlite);`

  
Thanks,&nbsp;  
  
Peter

---

<div class="post-metadata">

**Author:** ![Jay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@Jay](https://community.thinkgeo.com/u/Jay)\
**Post date:** [October 29, 2015, 8:56am UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474/3 "2015-10-29T08:56:19Z")

</div>

Hi&nbsp;Peter,&nbsp;thanks&nbsp;for&nbsp;the&nbsp;suggestions.&nbsp;I&nbsp;had&nbsp;already&nbsp;tried&nbsp;the&nbsp;leading&nbsp;eight&nbsp;backslashes&nbsp;without&nbsp;success.&nbsp;I&nbsp;hadn’t&nbsp;tried&nbsp;the&nbsp;verbatim&nbsp;string&nbsp;literal&nbsp;approach,&nbsp;but&nbsp;when&nbsp;I&nbsp;did,&nbsp;that&nbsp;met&nbsp;with&nbsp;no&nbsp;luck&nbsp;either.&nbsp;Just&nbsp;for&nbsp;fun,&nbsp;I&nbsp;tried&nbsp;combining&nbsp;the&nbsp;two,&nbsp;and&nbsp;that&nbsp;didn’t&nbsp;work&nbsp;either.

---

<div class="post-metadata">

**Author:** ![Jay](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@Jay](https://community.thinkgeo.com/u/Jay)\
**Post date:** [October 29, 2015, 2:23pm UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474/4 "2015-10-29T14:23:34Z")

</div>

Huh,&nbsp;that’ll&nbsp;teach&nbsp;me.&nbsp;The&nbsp;actual&nbsp;path&nbsp;being&nbsp;used&nbsp;was&nbsp;being&nbsp;constructed&nbsp;based&nbsp;on&nbsp;a&nbsp;config&nbsp;setting.&nbsp;I&nbsp;plugged&nbsp;the&nbsp;correct&nbsp;location&nbsp;in&nbsp;directly&nbsp;rather&nbsp;than&nbsp;going&nbsp;through&nbsp;that&nbsp;logic,&nbsp;and&nbsp;both&nbsp;the&nbsp;verbatim&nbsp;string&nbsp;and&nbsp;the&nbsp;eight&nbsp;backslash&nbsp;approaches&nbsp;worked.  
  
  
  
So&nbsp;it&nbsp;appears&nbsp;my&nbsp;problem&nbsp;is&nbsp;in&nbsp;how&nbsp;to&nbsp;specify&nbsp;it&nbsp;in&nbsp;the&nbsp;config&nbsp;setting,&nbsp;and&nbsp;the&nbsp;logic&nbsp;that&nbsp;uses&nbsp;it.  
  
  
  
Thanks&nbsp;for&nbsp;the&nbsp;help!

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [October 30, 2015, 3:28am UTC](https://community.thinkgeo.com/t/use-a-unc-path-with-worldmapkit/7474/5 "2015-10-30T03:28:34Z")

</div>

Hi&nbsp;Jay,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Glad&nbsp;to&nbsp;hear&nbsp;it&nbsp;works.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;Peter
