Python database access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arvind

    #1

    Python database access

    Hi all,
    I am going to work on Python 2.4.3 and MSSQL database server on
    Windows platform.
    But I don't know how to make the connectivity or rather which module to
    import.
    I searched for the modules in the Python library, but I couldn't find
    which module to go for.
    Please help me out!

  • Serge Orlov

    #2
    Re: Python database access

    On 25 Jun 2006 21:19:18 -0700, arvind <arvind.mulay@g mail.com> wrote:[color=blue]
    > Hi all,
    > I am going to work on Python 2.4.3 and MSSQL database server on
    > Windows platform.
    > But I don't know how to make the connectivity or rather which module to
    > import.
    > I searched for the modules in the Python library, but I couldn't find
    > which module to go for.[/color]

    The module you're looking for is the first result if you search
    "python mysql" on google or if you search "mysql" on python package
    index <http://www.python.org/pypi>

    Comment

    • Dave Cook

      #3
      Re: Python database access

      On 2006-06-26, Serge Orlov <serge.orlov@gm ail.com> wrote:[color=blue]
      > On 25 Jun 2006 21:19:18 -0700, arvind <arvind.mulay@g mail.com> wrote:[/color]
      [color=blue][color=green]
      >> I am going to work on Python 2.4.3 and MSSQL database server on
      >> Windows platform.[/color][/color]
      [color=blue]
      > The module you're looking for is the first result if you search
      > "python mysql" on google or if you search "mysql" on python package
      > index <http://www.python.org/pypi>[/color]

      I think he meant Microsoft SQL Server. In which case, google searches on
      "python mssql" and "python odbc" should be helpful.

      Dave Cook

      Comment

      • defcon8

        #4
        Re: Python database access


        arvind wrote:[color=blue]
        > Hi all,
        > I am going to work on Python 2.4.3 and MSSQL database server on
        > Windows platform.
        > But I don't know how to make the connectivity or rather which module to
        > import.
        > I searched for the modules in the Python library, but I couldn't find
        > which module to go for.
        > Please help me out![/color]

        I think there are a few recipes for mssql in the activestate python
        cookbook, or at least for odbc.

        Comment

        • BartlebyScrivener

          #5
          Re: Python database access

          > But I don't know how to make the connectivity or rather which module to[color=blue]
          > import.[/color]

          Try mxODBC

          mxODBC&trade; is the eGenix flagship product for connecting Python to all major databases, on all major platforms, using a fully Python DB-API 2.0 standard compatible ODBC interface, with many extensions and enhanced support of stored procedures with input, output and input/output parameters.


          Comment

          • vasudevram

            #6
            Re: Python database access


            The odbc module is part of the Python Standard Library. So you can
            search for docs on using it in the Python2x.chm help file (or the HTML
            version of the same docs) that comes with the Windows Python
            disttribution. Its quite easy to use ODBC from Python, at least for
            simple tasks like "select * from tablename".

            Vasudev Ram
            Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

            PDF conversion toolkt:
            http://sourceforge.net/projects/xtopdf


            BartlebyScriven er wrote:[color=blue][color=green]
            > > But I don't know how to make the connectivity or rather which module to
            > > import.[/color]
            >
            > Try mxODBC
            >
            > http://www.egenix.com/files/python/mxODBC.html[/color]

            Comment

            • madpython

              #7
              Re: Python database access

              arvind wrote:[color=blue]
              > Hi all,
              > I am going to work on Python 2.4.3 and MSSQL database server on
              > Windows platform.
              > But I don't know how to make the connectivity or rather which module to
              > import.
              > I searched for the modules in the Python library, but I couldn't find
              > which module to go for.
              > Please help me out![/color]
              i suggest pymssql. It doesnt throw runtime error while executing a
              query where prepackaged odbc module does.

              Comment

              • Damjan

                #8
                Re: Python database access

                > The odbc module is part of the Python Standard Library.

                Since when?


                --
                damjan

                Comment

                • Steve Holden

                  #9
                  Re: Python database access

                  Damjan wrote:[color=blue][color=green]
                  >>The odbc module is part of the Python Standard Library.[/color]
                  >
                  >
                  > Since when?
                  >
                  >[/color]
                  Nope, it's a standard part of Mark Hammond's win32all extensions. As
                  such it probably comes with ActivePython for Windows, which many people
                  use as their standard distro.

                  regards
                  Steve
                  --
                  Steve Holden +44 150 684 7255 +1 800 494 3119
                  Holden Web LLC/Ltd http://www.holdenweb.com
                  Love me, love my blog http://holdenweb.blogspot.com
                  Recent Ramblings http://del.icio.us/steve.holden

                  Comment

                  • vasudevram

                    #10
                    Re: Python database access


                    Yes, Steve is right. Sorry for the mistake. In my case, I don't use
                    Active Python, I use the vanilla Python for Windows (the .msi installer
                    from python.org) and then immediately install the win32all package,
                    link to which is usually on the same page as the MSI. I do this as a
                    routine, whenever I upgrade my Windows Python version. Mainly use
                    win32all for the PythonWin IDE (a pretty decent one, particularly the
                    debugging support) which comes with it, though the win32all package
                    also has some support for using COM from Python.

                    So when I did an "import ODBC", since I had not separately installed an
                    ODBC module, I thought it was part of the Standard Library - whereas
                    its a part of win32all.

                    Vasudev
                    ---
                    Vasudev Ram
                    Independent software consultant
                    Personal page: http://www.geocities.com/vasudevram
                    PDF conversion toolkit: http://sourceforge.net/projects/xtopdf (written
                    in Python, requires Python v2.2 or higher, ReportLab toolkit
                    (http://www.reportlab.org) v1.17 or higher).
                    Blog on software innovation: http://jugad.livejournal.com
                    ---

                    Steve Holden wrote:[color=blue]
                    > Damjan wrote:[color=green][color=darkred]
                    > >>The odbc module is part of the Python Standard Library.[/color]
                    > >
                    > >
                    > > Since when?
                    > >
                    > >[/color]
                    > Nope, it's a standard part of Mark Hammond's win32all extensions. As
                    > such it probably comes with ActivePython for Windows, which many people
                    > use as their standard distro.
                    >
                    > regards
                    > Steve
                    > --
                    > Steve Holden +44 150 684 7255 +1 800 494 3119
                    > Holden Web LLC/Ltd http://www.holdenweb.com
                    > Love me, love my blog http://holdenweb.blogspot.com
                    > Recent Ramblings http://del.icio.us/steve.holden[/color]

                    Comment

                    Working...