Thanks so much for the information, both of you. I guess I should have
just looked at it more simply to begin with. Now, I can move on to
more complicated information retrieval :-) My ultimate plan with this
task is to get whatever table attributes I can, like foreign/primary
keys, data types &
BartlebyScrivener wrote:
> Gau,
>
> This prints the names of the columns in my database.
>
> # Modification of
> # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/389535
> # Instructions for customizing are at:
> # http://www.egenix.com/files/python/mxODBC.html
>
> import mx.ODBC.Windows
Gau,
This prints the names of the columns in my database.
# Modification of
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/389535
# Instructions for customizing are at:
# http://www.egenix.com/files/python/mxODBC.html
import mx.ODBC.Windows as odbc
driv='DRIVER={Microsoft Access Driv
[EMAIL PROTECTED] wrote:
> I have an Access 2003 database, protected by a workgroup, that I am
> trying to view through python. Currently, I'm attempting dao with the
> win32 package, and I'm able to view all of the table names, but I don't
> know how to view the attributes of the tables.
>
> My
>> How can I get the names of the columns for each table??
SELECT * FROM mytable
--
http://mail.python.org/mailman/listinfo/python-list
For more reference, I got my information to start this from:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52267
When I try to run that code, it gives me this:
File "C:\Python24\Lib\site-packages\win32com\client\util.py", line
83, in next
return _get_good_object_(self._iter_.next()
BartlebyScrivener:
Maybe you're right, and I'll try posting to another group. However, I
have found resources for doing this using the same data structure:
"TableDefs" which is in VB and python. I see how they are doing it in
VB, but I don't know how this works in python. I was hoping someone
c
That would be fine for me to switch to mxodbc, I've used it before and
it worked fine. But if I switch, do you know how I can get the column
names from the table? Maybe I'm not being clear with my question here.
I'm going to try again
here's a table (it's in access):
=== tablename = mytabl
>> I was hoping that your code would
>> return the column names for me, but it was expecting me to list the
>> columns to use. I want to know how to retrieve that list of columns
>> through python.
I think once you establish connection to the database using Python and
mxODBC, then your question
Gau,
I'm a beginner and had fits connecting to my Access 2003 DB of
quotations. The best advice that finally worked for me was to use
mxODBC. In fact, you might just search this forum for Access and
mxODBC.
I can't customize to fit your situation, but here is the connection
part of a script I use
ok, I know what I had wrong :) I was hoping that your code would
return the column names for me, but it was expecting me to list the
columns to use. I want to know how to retrieve that list of columns
through python.
--
http://mail.python.org/mailman/listinfo/python-list
Here is the full code I'm using now to try out your sample:
import dbi, odbc
import win32com.client
from pprint import pprint
#sample code to list all tables in the selected database
daoEngine = win32com.client.Dispatch('DAO.DBEngine.36')
dtbs = daoEngine.OpenDatabase('database.mdb')
for table in
Em Sex, 2006-03-10 às 09:53 -0800, [EMAIL PROTECTED] escreveu:
> I have an Access 2003 database, protected by a workgroup, that I am
> trying to view through python. Currently, I'm attempting dao with the
> win32 package, and I'm able to view all of the table names, but I don't
> know how to view
I have an Access 2003 database, protected by a workgroup, that I am
trying to view through python. Currently, I'm attempting dao with the
win32 package, and I'm able to view all of the table names, but I don't
know how to view the attributes of the tables.
My code:
import win32com.client
from pp
14 matches
Mail list logo