Microsoft Access read from linux python

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

    Microsoft Access read from linux python

    Hello,

    I need to read data from a MS Access database.
    The program (reader) is installed on a linux box and
    is written in python langage.
    The database is MS Access 2002 installed on a Win XP box
    networked with the linux box.

    Is it possible for python/linux to read data from MS Access
    Database ?

    I've read a lot of things about mxODBC, iODBC and so on,
    but I'm still very confused, It looks like it is _not_
    possible.

    Ideas ? experiences ?

    David ROBERT.

  • Mark Carter

    #2
    Re: Microsoft Access read from linux python

    David ROBERT <david@ombrepix el.com> wrote in message news:<bno3nf$1f tp$1@biggoron.n erim.net>...[color=blue]
    > Hello,
    >
    > I need to read data from a MS Access database.
    > The program (reader) is installed on a linux box and
    > is written in python langage.
    > The database is MS Access 2002 installed on a Win XP box
    > networked with the linux box.
    >
    > Is it possible for python/linux to read data from MS Access
    > Database ?
    >
    > I've read a lot of things about mxODBC, iODBC and so on,
    > but I'm still very confused, It looks like it is _not_
    > possible.
    >
    > Ideas ? experiences ?[/color]

    AFAIK, Python IS able to access MS Access 2002 from Windows. You will
    need to install Python on Win XP, and install Mark Hammond's win32all.
    It can interface with any Microsoft COM component, which includes MS
    Office programs.

    You will need to write a Python script on Win XP that interrogates an
    Access database. Then you'll need to write some Python networking
    stuff to connect Win XP to Linux (maybe using XML-RPC).

    This assumes that you can't just export Access to a more open
    database, and ditch Access.

    [color=blue]
    >
    > David ROBERT.[/color]

    Comment

    • Cameron Laird

      #3
      Re: Microsoft Access read from linux python

      In article <d3c9c04.031029 0828.302971e6@p osting.google.c om>,
      Mark Carter <cartermark46@u kmail.com> wrote:[color=blue]
      >David ROBERT <david@ombrepix el.com> wrote in message
      >news:<bno3nf$1 ftp$1@biggoron. nerim.net>...[color=green]
      >> Hello,
      >>
      >> I need to read data from a MS Access database.
      >> The program (reader) is installed on a linux box and
      >> is written in python langage.
      >> The database is MS Access 2002 installed on a Win XP box
      >> networked with the linux box.
      >>
      >> Is it possible for python/linux to read data from MS Access
      >> Database ?
      >>
      >> I've read a lot of things about mxODBC, iODBC and so on,
      >> but I'm still very confused, It looks like it is _not_
      >> possible.
      >>
      >> Ideas ? experiences ?[/color]
      >
      >AFAIK, Python IS able to access MS Access 2002 from Windows. You will
      >need to install Python on Win XP, and install Mark Hammond's win32all.
      >It can interface with any Microsoft COM component, which includes MS
      >Office programs.
      >
      >You will need to write a Python script on Win XP that interrogates an
      >Access database. Then you'll need to write some Python networking
      >stuff to connect Win XP to Linux (maybe using XML-RPC).
      >
      >This assumes that you can't just export Access to a more open
      >database, and ditch Access.[/color]

      Comment

      • Alan Kennedy

        #4
        Re: Microsoft Access read from linux python

        [David ROBERT][color=blue]
        > I need to read data from a MS Access database.
        > The program (reader) is installed on a linux box and
        > is written in python langage.[/color]

        Hmmm. What is "the program"? Is it a python script you have written?
        Or that someone else has written and you must update? What is the
        "reading" that it does? How does it do it currently? DOes it run on a
        non-linux operating system?

        A python client running on linux can access any database on any server
        operating system if one can obtain an ODBC driver for that database.
        Both server and client need to understand ODBC, which is a kind of
        universal database protocol/API.
        [color=blue]
        > The database is MS Access 2002 installed on a Win XP box
        > networked with the linux box.[/color]

        If you can get an ODBC "data source" set up for that database, then
        you're half way there. On Win 2K (dunno about XP) Go to "Control
        Panel"->"Administrativ e Tools"->"Data Sources (ODBC)", and add a "DSN"
        for your MS Access database. There are security/privacy concerns
        related to informed choice of "System DSN" vs. "User DSN", which I'll
        leave for you to read up on.
        [color=blue]
        > Is it possible for python/linux to read data from MS Access
        > Database ?[/color]

        Yes, if the linux client supports ODBC. It's also possible to make
        modifications back to the database.

        Python has a standardised database API called "DB-API", which has very
        wide native support for a lot of different databases. A number of the
        currently available DB-API modules also support ODBC, which you can
        see on this page



        As far as I'm aware, most or all of the modules that support ODBC will
        run on linux.
        [color=blue]
        > I've read a lot of things about mxODBC, iODBC and so on,
        > but I'm still very confused, It looks like it is _not_
        > possible.[/color]

        Anything is possible. It's just a matter of effort ;-)

        --
        alan kennedy
        -----------------------------------------------------
        check http headers here: http://xhaus.com/headers
        email alan: http://xhaus.com/mailto/alan

        Comment

        • francois lepoutre

          #5
          Re: Microsoft Access read from linux python

          Hi David
          [color=blue]
          > I've read a lot of things about mxODBC, iODBC and so on,
          > but I'm still very confused, It looks like it is _not_
          > possible.[/color]
          [color=blue]
          > Ideas ? experiences ?[/color]

          It is of course possible... There are typically two ways into it
          as explained by Mark and Cameron.

          The solution by mark is more unixian in kind. The one by cameron
          using straight odbc is more win32-ish flavour in style.

          With only limited background in system admin, I have been
          quite happy with odbc and mxodbc for a couple of months now.
          On both win and linux boxes.

          So I'd recommend that you use odbc as an insulation layer between
          the MS connectivity stuff and your application. odbc is pretty stable now.

          Installation is not as straightforward on linux as on win32 where it's
          plain standard stuff but once set up, the stuff is clearly solid and
          workable.

          In the end you need a db middleware layer. The choice is yours.
          Go straight into win32 com and build then your own insulation thing
          using xml-rpc or rely on odbc all along the line.

          The choice will depend on your background and is, in the end, only
          a matter of choice.

          Francois


          Comment

          • Ben Finney

            #6
            Re: Microsoft Access read from linux python

            On Wed, 29 Oct 2003 11:10:43 +0100, David ROBERT wrote:[color=blue]
            > I've read a lot of things about mxODBC, iODBC and so on,
            > but I'm still very confused, It looks like it is _not_
            > possible.[/color]

            One thing to be wary of is that there is no ODBC module in Python, so
            you will need to read the copyright license of any third-party module
            you choose to use.

            The mxODBC module (as made by eGenix) is certainly not licensed as free
            software:

            <http://www.egenix.com/files/python/mxODBC.html#Cop yright>

            --
            \ "If you're a cowboy and you're dragging a guy behind your |
            `\ horse, I bet it would really make you mad if you looked back |
            _o__) and the guy was reading a magazine." -- Jack Handey |
            Ben Finney <http://bignose.squidly .org/>

            Comment

            • M.-A. Lemburg

              #7
              Re: Microsoft Access read from linux python

              David ROBERT wrote:[color=blue]
              > Hello,
              >
              > I need to read data from a MS Access database.
              > The program (reader) is installed on a linux box and
              > is written in python langage.
              > The database is MS Access 2002 installed on a Win XP box
              > networked with the linux box.
              >
              > Is it possible for python/linux to read data from MS Access
              > Database ?
              >
              > I've read a lot of things about mxODBC, iODBC and so on,
              > but I'm still very confused, It looks like it is _not_
              > possible.
              >
              > Ideas ? experiences ?[/color]

              It is certainly possible. Here are some pointers to get you started:

              EasySoft's ODBC-ODBC bridge:

              Access data sources such as Oracle, SQL Server, Salesforce, Access, InterBase, DB2, Derby, and Sybase from Windows, UNIX, Linux, and macOS.


              MDBTools ODBC driver:




              ODBC Socket Server:



              For a version with transaction support see UniverSQL:



              The setup is as follows:

              Python -> mxODBC -> ODBC driver/bridge/gateway -> data source

              The bridge and socket server basically interface the ODBC API
              from Unix to Windows, so you are talking to the Windows
              ODBC driver for MS Access. The MDB tools work directly
              on the access files; not sure whether Access 2000 is supported
              though.

              BTW, if you can, I'd suggest to switch from Access to the
              MS Desktop Engine (MSDE) 2000 which is basically MS SQL Server
              2000 without the GUI tools and available as free download
              from MS. You can use the FreeTDS ODBC driver to talk to it
              from Linux or one of the many available commercial ODBC
              drivers to access MS SQL Server from Linux.

              HTH,
              --
              Marc-Andre Lemburg
              eGenix.com

              Professional Python Software directly from the Source (#1, Oct 30 2003)[color=blue][color=green][color=darkred]
              >>> Python/Zope Products & Consulting ... http://www.egenix.com/
              >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/[/color][/color][/color]
              _______________ _______________ _______________ _______________ ____________

              ::: Try mxODBC.Zope.DA for Windows,Linux,S olaris,FreeBSD for free ! ::::


              Comment

              • Mark Roach

                #8
                Re: Microsoft Access read from linux python

                On Wed, 29 Oct 2003 11:10:43 +0100, David ROBERT wrote:
                [color=blue]
                > I need to read data from a MS Access database.
                > The program (reader) is installed on a linux box and
                > is written in python langage.
                > The database is MS Access 2002 installed on a Win XP box
                > networked with the linux box.[/color]
                [color=blue]
                > Is it possible for python/linux to read data from MS Access
                > Database ?[/color]

                mdbtools: http://mdbtools.sourceforge.net/ provides a unixODBC
                driver for MS access databases. Install it and mxODBC, then you
                should be able to create a DSN for the access db, and connect to
                it using mxODBC
                [color=blue]
                > I've read a lot of things about mxODBC, iODBC and so on,
                > but I'm still very confused, It looks like it is _not_[/color]

                What exactly are you confused about? Perhaps someone can help
                answer some specific questions...

                -Mark

                Comment

                • Alan Kennedy

                  #9
                  Re: Microsoft Access read from linux python

                  [David ROBERT][color=blue][color=green]
                  >> I've read a lot of things about mxODBC, iODBC and so on,
                  >> but I'm still very confused, It looks like it is _not_
                  >> possible.[/color][/color]

                  [Ben Finney][color=blue]
                  > One thing to be wary of is that there is no ODBC module in Python, so
                  > you will need to read the copyright license of any third-party module
                  > you choose to use.
                  >
                  > The mxODBC module (as made by eGenix) is certainly not licensed as free
                  > software:
                  >
                  > <http://www.egenix.com/files/python/mxODBC.html#Cop yright>[/color]

                  I meant to reply to this last week, but forgot.

                  There is a completely free (in all senses of the word) and open-source
                  ODBC module for python: It is Brian Zimmer's/Ziclix zxJDBC.

                  Of course, you're not going to like that either Ben, because it's in
                  Java and runs under jython.

                  But it is a free python ODBC library.

                  kind regards,

                  --
                  alan kennedy
                  -----------------------------------------------------
                  check http headers here: http://xhaus.com/headers
                  email alan: http://xhaus.com/mailto/alan

                  Comment

                  • Paul Rudin

                    #10
                    Re: Microsoft Access read from linux python

                    >>>>> "Alan" == Alan Kennedy <alanmk@hotmail .com> writes:
                    [color=blue]
                    > [David ROBERT][color=green][color=darkred]
                    >>> I've read a lot of things about mxODBC, iODBC and so on, but
                    >>> I'm still very confused, It looks like it is _not_ possible.[/color][/color][/color]
                    [color=blue]
                    > [Ben Finney][color=green]
                    >> One thing to be wary of is that there is no ODBC module in
                    >> Python, so you will need to read the copyright license of any
                    >> third-party module you choose to use.
                    >>
                    >> The mxODBC module (as made by eGenix) is certainly not licensed
                    >> as free software:
                    >>
                    >> <http://www.egenix.com/files/python/mxODBC.html#Cop yright>[/color][/color]
                    [color=blue]
                    > I meant to reply to this last week, but forgot.[/color]
                    [color=blue]
                    > There is a completely free (in all senses of the word) and
                    > open-source ODBC module for python: It is Brian Zimmer's/Ziclix
                    > zxJDBC.[/color]
                    [color=blue]
                    > Of course, you're not going to like that either Ben, because
                    > it's in Java and runs under jython.[/color]
                    [color=blue]
                    > But it is a free python ODBC library.[/color]


                    There's also an odbc module with the win32all thing, which is free.

                    Comment

                    • Alan Kennedy

                      #11
                      Re: Microsoft Access read from linux python

                      [Alan Kennedy][color=blue][color=green]
                      >> There is a completely free (in all senses of the word) and
                      >> open-source ODBC module for python: It is Brian Zimmer's/Ziclix
                      >> zxJDBC.[/color][/color]

                      [Paul Rudin][color=blue]
                      > There's also an odbc module with the win32all thing, which is free.[/color]

                      Thanks Paul, I wasn't previously aware of that.

                      So it seems the only people without access to a free (in all senses of
                      the word) python ODBC driver are those who won't use Windows or Java
                      ........

                      regards,

                      --
                      alan kennedy
                      -----------------------------------------------------
                      check http headers here: http://xhaus.com/headers
                      email alan: http://xhaus.com/mailto/alan

                      Comment

                      Working...