<?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>Question Re: pyodbc issues (Python) in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831173#M4862016</link>
    <description>&lt;P&gt;If you cannot set the connection_authentication option via code, it has to be specified via the &lt;STRONG&gt;InitString connection parameter&lt;/STRONG&gt;, see the OLEDB sample &lt;A href="https://dcx.sap.com/index.html#sqla170/en/html/814c10586ce210149a6681971de0c6d6.html"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Apr 2022 06:56:39 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2022-04-22T06:56:39Z</dc:date>
    <item>
      <title>pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaq-p/13831166</link>
      <description>&lt;P&gt;I am trying to connect to a SQL Anywhere 17 Database from Python using pyodbc Module.&lt;/P&gt;
&lt;P&gt;The connect looks like:
mydb=pyodbc.connect('DSN=&lt;STRONG&gt;mydsn&lt;/STRONG&gt;;UID=&lt;STRONG&gt;dba&lt;/STRONG&gt;;pwd=&lt;STRONG&gt;mypwd&lt;/STRONG&gt;;Company=&lt;STRONG&gt;mycompany&lt;/STRONG&gt;;Application=&lt;STRONG&gt;myapp&lt;/STRONG&gt;;Signature=&lt;STRONG&gt;mysignature&lt;/STRONG&gt;')&lt;/P&gt;
&lt;P&gt;The database runs as a service (dbsvc), and the connection works only if the the database doesnt have other connections open. i.e. if I connect to the database using dbisql then has my Python script no any chance to connect to the DB and I get the following error:
&lt;/P&gt;&lt;PRE&gt;Unable to initialize performance monitor data area; server startup continuing
SQL Anywhere Personal Server Version 17.0.9.4803
Developer edition, not licensed for deployment.
Copyright © 2018 SAP SE or an SAP affiliate company.
All rights reserved.
Use of this software is governed by the SAP Software Use Rights Agreement.
Refer to &lt;A href="http://www.sap.com/about/agreements.html." target="_blank"&gt;http://www.sap.com/about/agreements.html.&lt;/A&gt;
Connection limit (Personal Server): 10
Processors detected: 8 logical processor(s) on 4 core(s) on 1 physical processor(s)
Processor license restriction (Personal Server): all logical processors on at most 4 core(s) on at most 1 physical processor(s)
This server is licensed to use: all logical processors on at most 4 core(s) on at most 1 physical processor(s)
Processors in use by server: 8 logical processor(s) on 4 core(s) on 1 physical processor(s)
This server is licensed to:
    Developer Edition
    Restricted Use
Running Windows 10 Build 19043  on X86_64
Server built for X86_64 processor architecture
51464K of memory used for caching
Minimum cache size: 51452K, maximum cache size: 7453104K
Using a maximum page size of 2048 bytes
Multiprogramming level: 20
Database server shutdown due to startup error
Database server stopped at Wed Apr 20 2022 16:08
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 10:09:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaq-p/13831166</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2022-04-20T10:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831167#M4862010</link>
      <description>&lt;P&gt;If you specify a DSN, do the DSN's connection parameters conflict with the running database, say, you are trying to explicitly start a database file that is already running - possibly with a different name? You might use a DSN-less connection string, see &lt;A href="https://sqlanywhere-forum.sap.com/questions/36133/connecting-to-sql17-from-python"&gt;your older question here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;To add: Do you use the -oe server option to log startup errors in a different message log? If so, what does that tell?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 11:01:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831167#M4862010</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-04-20T11:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831168#M4862011</link>
      <description>&lt;P&gt;I can't use DSN-less connection, since the servername varies among devices, and only the DSN name is fix.&lt;/P&gt;
&lt;P&gt;BTW, the other connection (over dbisql) uses also same DSN, so there might not be any chance for a conflict.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 03:15:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831168#M4862011</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2022-04-21T03:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831169#M4862012</link>
      <description>&lt;P&gt;Well, so what's in the DSN? And what kind of DSN is this - system or user? &lt;/P&gt;
&lt;P&gt;Note that system DSNs with the same name are not shared between 32-bit and 64-bit. May this have an effect here (in case you are using a 64-bit DBISQL and a 32-bit Python process or vice versa)?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 03:27:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831169#M4862012</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-04-21T03:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831170#M4862013</link>
      <description>&lt;P&gt;Are you connecting to an already running database server?  The engine log posted appears to be suggesting that the database server is being autostarted.  It is attempting to start a personal server (dbengX). And, there is already an engine running as indicated by the first line of the engine log. &lt;/P&gt;
&lt;P&gt;Adding LOG= to the connection string will log connection diagnostic info and include the actual connection string that is used for connecting (logged as "Attempting to connect using:". Please note that the following "Company=mycompany;Application=myapp;Signature=mysignature" is not valid connection parms. &lt;/P&gt;
&lt;P&gt;Here is an example connection with LOG:  &lt;/P&gt;
&lt;P&gt;mydb=pyodbc.connect('DSN=mydsn;UID=dba;pwd=mypwd;log=&amp;lt;path&amp;gt;\\filename' )&lt;/P&gt;
&lt;P&gt;I would also run the server with -z to collect server side communication logging i.e., it will log connection attempts.&lt;/P&gt;
&lt;P&gt;My guess is that the database server name and database name defined in the DSN do not match the running database server and then it attempts to start a database server and is unable. The client and server communication diagnostic logs will collect the information that will identify the cause.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 08:18:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831170#M4862013</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2022-04-21T08:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831171#M4862014</link>
      <description>&lt;P&gt;I also recommend that you include Server=xxx in your connection string or data source specifying the server name. I find that omitting it prevents connecting to a personal server running as a service.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 14:10:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831171#M4862014</guid>
      <dc:creator>jack_schueler</dc:creator>
      <dc:date>2022-04-21T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831172#M4862015</link>
      <description>&lt;P&gt;Is there any documentation how the connection string should look like?
&lt;/P&gt;&lt;PRE&gt;Please note that the following "Company=mycompany;Application=myapp;Signature=mysignature" is not valid connection parms.
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;where should I then define my authentication string?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 05:59:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831172#M4862015</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2022-04-22T05:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831173#M4862016</link>
      <description>&lt;P&gt;If you cannot set the connection_authentication option via code, it has to be specified via the &lt;STRONG&gt;InitString connection parameter&lt;/STRONG&gt;, see the OLEDB sample &lt;A href="https://dcx.sap.com/index.html#sqla170/en/html/814c10586ce210149a6681971de0c6d6.html"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 06:56:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831173#M4862016</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-04-22T06:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: pyodbc issues (Python)</title>
      <link>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831174#M4862017</link>
      <description>&lt;P&gt;You should start with the &lt;A href="https://help.sap.com/docs/SAP_SQL_Anywhere/61ecb3d4d8be4baaa07cc4db0ddb5d0a/81389dff6ce21014bfc29cc9ef319bbd.html?version=17.0"&gt;link textSQL Anywhere Database Administration | Database Connections&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 08:11:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/pyodbc-issues-python/qaa-p/13831174#M4862017</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2022-04-22T08:11:00Z</dc:date>
    </item>
  </channel>
</rss>

