Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
Rename field in Access DB
 

Index | Next | Previous | View Flat


iainking at gmail

May 14, 2008, 8:08 AM


Views: 411
Permalink
Rename field in Access DB

I'm manipulating an MS Access db via ADODB with win32com.client. I
want to rename a field within a table, but I don't know how to. I
assume there is a line of SQL which will do it, but nothing I've tried
(from searching) has worked.
Basic code:

import win32com.client
connection = win32com.client.Dispatch(r'ADODB.Connection')
DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=dbfile.mdb;'
connection.Open(DSN)
connection.Execute("ALTER TABLE tablename CHANGE from to") #this sql
doesn't work
connection.Close()

Anyone know how to get this to work?

Iain
--
http://mail.python.org/mailman/listinfo/python-list

Subject User Time
Rename field in Access DB iainking at gmail May 14, 2008, 8:08 AM
    Re: Rename field in Access DB deets at nospam May 14, 2008, 8:09 AM
    Re: Rename field in Access DB mail at timgolden May 14, 2008, 8:29 AM
    Re: Rename field in Access DB iainking at gmail May 15, 2008, 1:31 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.