Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A003D9FB434 for ; Fri, 2 Mar 2007 19:24:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 99760-03 for ; Fri, 2 Mar 2007 19:24:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from yucaipaco.com (yucaipaco.com [82.165.181.113]) by postgresql.org (Postfix) with ESMTP id C71889FB427 for ; Fri, 2 Mar 2007 19:24:03 -0400 (AST) Received: (qmail 10148 invoked by uid 210); 2 Mar 2007 15:26:28 -0800 Received: from 10.23.112.225 by yucmail (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.88.2/1624. f-prot: 4.6.5/3.16.13. spamassassin: 3.1.3. perlscan: 1.25st. Clear:RC:1(10.23.112.225):. Processed in 0.339285 secs); 02 Mar 2007 23:26:28 -0000 Received: from unknown (HELO ?10.23.112.225?) (yucrelay@10.23.112.225) by yucaipaco.com with ESMTPA; 2 Mar 2007 15:26:27 -0800 Message-ID: <45E8B1F2.4020804@yucaipaco.com> Date: Fri, 02 Mar 2007 15:23:30 -0800 From: David Gardner User-Agent: Thunderbird 1.5.0.9 (X11/20070131) MIME-Version: 1.0 To: pgsql-odbc@postgresql.org Subject: Re: ODBC problem with Microsoft Word and Excel References: <00bc01c75d00$fcbd5c40$0d01a8c0@karlsdesktop> In-Reply-To: <00bc01c75d00$fcbd5c40$0d01a8c0@karlsdesktop> Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/20 X-Sequence-Number: 8698 I remember having problems with this. What I did was to move my query to a pqsql function, and then pass Word the ODBC DSN with a SQL query of "SELECT * FROM mypgfunction(parameter)". I also ran into a problem where Word would see the column names correctly, and the row count would be correct, but all the data fields were blank, I switched to using the ANSI driver and that resolved it. Take a look at the following VBA code snipet: Dim oWord As Word.Application Dim oDoc As Word.Document Dim oMM As Word.mailmerge 'Start Word Set oWord = CreateObject("Word.Application") oWord.Visible = True ' create new document Set oMM = oWord.Documents.Add.mailmerge End If oMM.MainDocumentType = wdFormLetters oMM.OpenDataSource Name:="", Connection:="DSN=DSNName", SQLStatement:="SELECT * FROM mypgfunction(stuff)" oMM.ShowWizard 1 oMM.EditMainDocument Karl Denninger wrote: > > I’ve loaded the most recent ODBC driver off the Postgresql FTP site. > > > > The DBMS is functioning, has other applications (libpq, etc) operating > perfectly, and the “Test” functionality from the “Data Sources” setup > shows that I can connect to the database desired when I declare the > connection. > > > > However, when I attempt to go into either WORD (to use it as a mail > merge source) or EXCEL (just for grins to pull data from there) I > connect to “ODBC DSN”, click “PostgreSQL30W” (the driver that was set > up in the Data Sources panel), I immediately get “Unable to get list > of tables from the data source”. > > > > What’s going on?! > > > > -- Karl Denninger karl@denninger.net > > Diving? See http://www.scubaforum.org > > > > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: > 3/1/2007 2:43 PM >