Sebastian:<br>  You have what looks (to a non-Postgres user) like a proper ADO connection string for PostgreSQL. Open the Postgres database using adodbapi. I have already done all of the tricky COM stuff for you.  You can also open the ACCESS database using adodbapi.  There is an example in C:\python{your version number here}\Lib\site-packages\adodbapi\tests\db_print.py .<br>

  Given that your databases are so completly different, you will most likely need to copy the data field-by-field. I think you will find no pre-packaged move-this-whole-table shortcut for this job. <br>  If the Postgres will not work for you, please let me know. I am planning to add Postgres tests and examples to the adodbapi test suite, and have set up a test server, but have not made the time to get further. We could work together on Postgres support.<br>

  By the way, I disagree with  Gerdus. I personally find Python much easier to use than VBA for prototyping and quickie jobs. <br>--<br>Vernon Cole<br><br><div class="gmail_quote">On Wed, Jul 29, 2009 at 6:16 AM, Gerdus van Zyl <span dir="ltr">&lt;<a href="mailto:gerdusvanzyl@gmail.com">gerdusvanzyl@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Are you trying to copy a table from an access database to a postgres<br>
database? Because that&#39;s the impression I get, in which case do you<br>
need to do it once or do you need to do it regularly? In both cases<br>
Python might not be an optimal choice.<br>
You might have more luck using TransferDatabase and ODBC, and first<br>
prototype in VBA then transfer to Python.  Also if you could explain<br>
what you are trying to do, we might be better able to help.<br>
<font color="#888888"><br>
~Gerdus<br>
</font><div><div></div><div class="h5"><br>
On Wed, Jul 29, 2009 at 10:23 AM, Tim Golden&lt;<a href="mailto:mail@timgolden.me.uk">mail@timgolden.me.uk</a>&gt; wrote:<br>
&gt; [copying back to the list]<br>
&gt;<br>
&gt;&gt; Not sure how to reply to the thread, since I thought that if I reply to<br>
&gt;&gt; &quot;<a href="mailto:python-win32@python.org">python-win32@python.org</a>&quot; then it would start a new thread?<br>
&gt;<br>
&gt; Replying to <a href="mailto:python-win32@python.org">python-win32@python.org</a> is the right thing to<br>
&gt; do; the mailing list software should recognise all the<br>
&gt; clues it needs to continue the thread.<br>
&gt;<br>
&gt;<br>
&gt; <a href="mailto:sebastian.venus@uk.bnpparibas.com">sebastian.venus@uk.bnpparibas.com</a> wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi Tim,<br>
&gt;&gt;<br>
&gt;&gt; I tried this:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; a = win32com.client.Dispatch(&quot;access.application&quot;)<br>
&gt;&gt;&gt;&gt;&gt; connStr = &#39;Driver={PostgreSQL<br>
&gt;&gt;<br>
&gt;&gt; Unicode};Server=%s;Database=%s;Uid=%s;Pwd=%s;ConnSettings=&quot;set TimeZone to<br>
&gt;&gt; -8; set search_path to pid,public;&quot;&#39;<br>
&gt;<br>
&gt; Well that surprised me: you&#39;re using Access as a frontend<br>
&gt; to PostgreSQL?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; a.OpenCurrentDatabase(r&#39;C:/TEMP/db1.mdb&#39;)<br>
&gt;&gt;&gt;&gt;&gt; a.DoCmd.CopyObject(connStr,&#39;MyTable2&#39;,0,&#39;MyTable1&#39;)<br>
&gt;&gt;<br>
&gt;&gt; but it threw an exception that I couldn&#39;t interpret. Can you please help?<br>
&gt;<br>
&gt; This is obviously tricky with two different databases in the equation, one<br>
&gt; of them PostgreSQL, but what will be<br>
&gt; most helpful is for you to produce an easily reproducible<br>
&gt; sample which someone else can run, plus the traceback you<br>
&gt; get. Going through this exercise may even cause you to<br>
&gt; track down the problem yourself. In particular, try to<br>
&gt; eliminate external dependencies: try to do the copy table<br>
&gt; thing between two Access databases, or within the same<br>
&gt; one (if that&#39;s possible; I haven&#39;t used Access in earnest<br>
&gt; for a while now).<br>
&gt;<br>
&gt; TJG<br>
&gt; _______________________________________________<br>
&gt; python-win32 mailing list<br>
&gt; <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
&gt;<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
</div></div></blockquote></div><br>