473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Database Programming with Python

Hi

I wanted to connect Python to Ms-Access database using ADO or ODBC. I
have Python 2.5 and on mxODBC site, it has no higher version build
than 2.4. Moreoever, mxODBC is required for ADODB.
Can anyone guide me on this what should I do to make it work on Python
2.5? I have python 2.5 running on server.

Feb 9 '07 #1
4 2662
On Feb 9, 7:28 am, Finger.Octo...@gmail.com wrote:
I wanted to connect Python to Ms-Access database using ADO or ODBC. I
have Python 2.5 and on mxODBC site, it has no higher version build
than 2.4. Moreoever, mxODBC is required for ADODB.
Can anyone guide me on this what should I do to make it work on Python
2.5? I have python 2.5 running on server.
You could use Dejavu 1.5, which has its own wrapper [1] for ADO (both
MS Access and SQL Server/MSDE). No ODBC necessary or desired.

If you want an ADO wrapper without the full Dejavu ORM, it's possible
(but not heavily documented) to use dejavu's geniusql layer on its
own. That would give you connection mgmt (and pooling), along with the
ability to execute arbitrary SQL.
Robert Brewer
System Architect
Amor Ministries
fu******@amor.org

[1] http://projects.amor.org/dejavu/brow...ge/storeado.py

Feb 9 '07 #2
You could use Dejavu 1.5, which has its own wrapper [1] for ADO (both
MS Access and SQL Server/MSDE). No ODBC necessary or desired.

If you want an ADO wrapper without the full Dejavu ORM, it's possible
(but not heavily documented) to use dejavu's geniusql layer on its
own. That would give you connection mgmt (and pooling), along with the
ability to execute arbitrary SQL.

Robert Brewer
System Architect
Amor Ministries
fuman...@amor.org

[1]http://projects.amor.org/dejavu/browser/trunk/storage/storeado.py

There are no examples of Dejavu that I found yet. I have installed it
but don't know how to use or call its functions.

Feb 9 '07 #3
On Feb 9, 11:03 am, Finger.Octo...@gmail.com wrote:
There are no examples of Dejavu that I found yet. I have installed it
but don't know how to use or call its functions.
Read http://projects.amor.org/docs/dejavu/1.5.0RC1/ to learn how to
use Dejavu. It's short and should at least give you an idea whether or
not Dejavu is right for you.
Robert Brewer
System Architect
Amor Ministries
fu******@amor.org

Feb 9 '07 #4
Fi************@gmail.com wrote:
>
I wanted to connect Python to Ms-Access database using ADO or ODBC. I
have Python 2.5 and on mxODBC site, it has no higher version build
than 2.4. Moreoever, mxODBC is required for ADODB.
Can anyone guide me on this what should I do to make it work on Python
2.5? I have python 2.5 running on server.
You don't actually need mxODBC to use ADODB. As long as you have the
pywin32 extensions, you have what you need.

import win32com.client
conn = win32com.client.Dispatch('ADODB.Connection')
conn.Open( "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=xxxxx.mdb" )
cmd = win32com.client.Dispatch('ADODB.Command')
cmd.ActiveConnection = conn

cmd.CommandText = "SELECT firstname,lastname FROM users;"
rs = cmd.Execute()[0]
while not rs.EOF:
# Use elements of rs
rs.MoveNext()

There are samples on the web. Google should help.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Feb 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Patrick K. O'Brien | last post by:
I'm working on an ODBMS written in Python, for Python, and was wondering if anyone was interested. In particular, I'd like to know what features would be useful, and what types of use cases people...
3
by: Michael T. Babcock | last post by:
I'm working with databases (MySQL primarily) more and more with Python, and having used PERL in the past for similar work, I'm wondering if there are good tools for doing 'intelligent'...
5
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for...
6
by: Wolfgang Keller | last post by:
Hello, I'm looking for a spreadsheet application (MacOS X prefered, but Windows, Linux ar available as well) with support for Python scripting (third-party "plug-ins" are ok) and a database...
13
by: Robin Haswell | last post by:
Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break down in to lots of modules...
23
by: herraotic | last post by:
I have been getting ready to learn programming for a long time, installed a GNU/Linux operating system, learnt the ins and outs but I think it is time to pick up a book and learn to now program. ...
2
by: GinTon | last post by:
EyeDB is a free ODBMS based on the ODMG 3 specification with programming interfaces for C++ and Java. It is very powerfull, mature, safe and stable. In fact, it was developed in 1992 for the Genome...
38
by: ifti_crazy | last post by:
I am VB6 programmer and wants to start new programming language but i am unable to deciced. i have read about Python, Ruby and Visual C++. but i want to go through with GUI based programming...
7
by: erikcw | last post by:
Hi, I'm working on a web application where each user will be creating several "projects" in there account, each with 1,000-50,000 objects. Each object will consist of a unique name, an id, and...
14
by: mark | last post by:
Hi there, I need to extract data from text files (~4 GB) on this data some operations are performed like avg, max, min, group etc. The result is formated and written in some other text files...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.