<?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: Creating an OLE DB connection to a SQLServer database in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488128#M38121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Start here: &lt;A href="http://code.google.com/p/pyodbc/"&gt;http://code.google.com/p/pyodbc/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You'll have to download and install pyodbc, make sure you get the version that matches the python version you have installed, most likely the version that installed with ArcGIS.&lt;BR /&gt;&lt;BR /&gt;###########&lt;BR /&gt;&lt;BR /&gt;import arcpy, pyodbc&lt;BR /&gt;&lt;BR /&gt;cnxn = DRIVER={SQL Server};SERVER=cloak;DATABASE=test;UID=user;PWD=password&lt;BR /&gt;&lt;BR /&gt;cursor = cnxn.cursor()&lt;BR /&gt;&lt;BR /&gt;cursor.execute("{any legal SQL stmt you would execute in SSMS}")&lt;BR /&gt;&lt;BR /&gt;cnxn.commit()&lt;BR /&gt;&lt;BR /&gt;###########&lt;BR /&gt;&lt;BR /&gt;I use it to get the functionality out of ArcGIS and the speed of SQL.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you or others experienced issues of secondary runs when pyodbc is run from ArcGIS/ArcCatalog(9.3.1) Toolbox?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a 9999998 Error when the script/tool with pyodbc is run a second time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;note: I don't have this issue with cx_Oracle. Just exploring alternative ways to connect to non-spatial data repositories.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2012 14:13:42 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2012-11-20T14:13:42Z</dc:date>
    <item>
      <title>Creating an OLE DB connection to a SQLServer database</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488126#M38119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm fairly new to Python, so please bear with me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a link to a SQLServer database using OLEDB and i haven't got a clue where to start.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone help please? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Claire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 14:23:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488126#M38119</guid>
      <dc:creator>ClaireParsons</dc:creator>
      <dc:date>2012-03-27T14:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an OLE DB connection to a SQLServer database</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488127#M38120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Start here: &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/pyodbc/"&gt;http://code.google.com/p/pyodbc/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll have to download and install pyodbc, make sure you get the version that matches the python version you have installed, most likely the version that installed with ArcGIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;###########&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, pyodbc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cnxn = DRIVER={SQL Server};SERVER=cloak;DATABASE=test;UID=user;PWD=password&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor = cnxn.cursor()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cursor.execute("{any legal SQL stmt you would execute in SSMS}")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cnxn.commit()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;###########&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use it to get the functionality out of ArcGIS and the speed of SQL.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 01:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488127#M38120</guid>
      <dc:creator>KeithSandell</dc:creator>
      <dc:date>2012-04-02T01:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an OLE DB connection to a SQLServer database</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488128#M38121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Start here: &lt;A href="http://code.google.com/p/pyodbc/"&gt;http://code.google.com/p/pyodbc/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You'll have to download and install pyodbc, make sure you get the version that matches the python version you have installed, most likely the version that installed with ArcGIS.&lt;BR /&gt;&lt;BR /&gt;###########&lt;BR /&gt;&lt;BR /&gt;import arcpy, pyodbc&lt;BR /&gt;&lt;BR /&gt;cnxn = DRIVER={SQL Server};SERVER=cloak;DATABASE=test;UID=user;PWD=password&lt;BR /&gt;&lt;BR /&gt;cursor = cnxn.cursor()&lt;BR /&gt;&lt;BR /&gt;cursor.execute("{any legal SQL stmt you would execute in SSMS}")&lt;BR /&gt;&lt;BR /&gt;cnxn.commit()&lt;BR /&gt;&lt;BR /&gt;###########&lt;BR /&gt;&lt;BR /&gt;I use it to get the functionality out of ArcGIS and the speed of SQL.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you or others experienced issues of secondary runs when pyodbc is run from ArcGIS/ArcCatalog(9.3.1) Toolbox?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a 9999998 Error when the script/tool with pyodbc is run a second time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;note: I don't have this issue with cx_Oracle. Just exploring alternative ways to connect to non-spatial data repositories.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 14:13:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488128#M38121</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-11-20T14:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an OLE DB connection to a SQLServer database</title>
      <link>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488129#M38122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apparently ArcCatalog simply doesn't like pyodbc all that much.&amp;nbsp; Supposedly it has to do with the way ArcCatalog handles conneciton pooling.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...sticking with cx_Oracle for the time being.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 14:36:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-an-ole-db-connection-to-a-sqlserver/m-p/488129#M38122</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2012-11-21T14:36:41Z</dc:date>
    </item>
  </channel>
</rss>

