Roger Upole wrote:
Jim.Vickroy wrote:
  
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.
    

I think Sql Server requires that you create the table before
adding any keys. Try moving the table.Keys.Append
to after catalog.Tables.Append.

     Roger

_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32
  
Thank-you, Roger!  You are correct.  I was slowly being forced to the same conclusion, but you saved me considerable time trying permutations.

I started by getting an Access script to work and then naively assumed all I had to do was change the connection string, but that was wrong.

In case anyone is interested, I have attached a working example of  how to create a SQL Express database with one table comprising two columns -- one of which is designated as the primary key.

Thanks again to all who offered suggestions.

-- jv

Attachment: sqlexpress.py
Description: application/python

_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to