Might I suggest just using a "CREATE TABLE" sql statement through ADO instead?
sqlstatement = "CREATE TABLE SPAM (SpamID Int Not Null, Eggs Char(20));"
conn = win32com.client.Dispatch(r'ADODB.Connection')
DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=' + self.dbpath + ';'
conn.Open(DSN)
#Query the recordset - should be in module with establishing connection stuff
rs = win32com.client.Dispatch(r'ADODB.Recordset')
try:
rs.Open(sqlstatement, conn,1 ,3)
except:
print 'DB Error'
Eric B. Powell
BSRI
Electronic Aids
(803)208-6207
[EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED] 07/10/2006 05:52 PM |
|
Hello,
I am a novice user of ADOX who is attempting to create a database and
a table in it.
I seem to be able to create a SQL Express database but am unable to
add a table to it.
The attached script (adox.py) illustrates the difficulty.
Any suggestions would be appreciated.
Thanks,
-- jv
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
adox.py
Description: Binary data
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32