<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Roger Upole wrote:
<blockquote cite="mid003101c6a552$8f12c0b0$0100a8c0@rupole" type="cite">
<pre wrap="">Jim.Vickroy wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
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
<a class="moz-txt-link-abbreviated" href="mailto:Python-win32@python.org">Python-win32@python.org</a>
<a class="moz-txt-link-freetext" href="http://mail.python.org/mailman/listinfo/python-win32">http://mail.python.org/mailman/listinfo/python-win32</a>
</pre>
</blockquote>
Thank-you, Roger! You are correct. I was slowly being forced to the
same conclusion, but you saved me considerable time trying permutations.<br>
<br>
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.<br>
<br>
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.<br>
<br>
Thanks again to all who offered suggestions.<br>
<br>
-- jv<br>
</body>
</html>