connection mssql via database api 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cemyildiz
    New Member
    • Feb 2012
    • 5

    connection mssql via database api 2.0

    hi,

    i have an sql server 2005 database, and a username. with a software called navicat, i can connect there remotely and i can create tables.

    actually i have to access there via python and database api 2.0, here i share the user name and password too:

    Code:
    import adodbapi
    ConnectionString = "Provider=SQLOLEDB.1;Data Source=sql2002.shared-servers.com,1086;Initial Catalog=ableton;User ID=ableton;Password=miklagard1;Trusted_Connection=False;"
    conn = adodbapi.connect(ConnectionString)
    and i got this error:
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/Library/Frameworks/Python.framewor k/Versions/2.7/lib/python2.7/site-packages/adodbapi/adodbapi.py", line 298, in connect
    raise InterfaceError #Probably COM Error
    adodbapi.adodba pi.InterfaceErr or

    I have tried to change the database into sql server 2008, i got the same error. Anyone has any idea where am i making the mistake?

    Thanks.
  • cemyildiz
    New Member
    • Feb 2012
    • 5

    #2
    I have installed this module:

    Download Python DB-API 2.0 module for ADO for free. Use Microsoft ADO to read/write most data bases. Python module that makes it easy to use Microsoft ADO for connecting with databases and other data sources. For CPython users, this module is included as part of pywin32 (https://github.com/mhammond/pywin32), and continued support will take place there.


    And I am using Mac OS X 10.7.3 as the OS, and Python 2.4.4.

    Comment

    • cemyildiz
      New Member
      • Feb 2012
      • 5

      #3
      well i have solved it myself. i needed iron python which doesn't work in mac os. i am actually working on a pc instead of mac.

      Comment

      Working...