Re: ODBC problem with Microsoft Word and Excel

From: "david(dot)paulo" <david(dot)paulo(at)legalfirst(dot)com(dot)au>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: ODBC problem with Microsoft Word and Excel
Date: 2015-10-07 05:47:07
Message-ID: 1444196827343-5869049.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Here is what I needed to do
1) Use ANSI odbc driver - this is key - Unicode does not work - I am using
version 9.03.04.00. In this example the name of the odbc DSN is LFData. It
has a username and password embedded in it.
2) It may not be needed for word merge (I am also doing separate queries)
but I registered Microsoft ActiveX Data Objects 6.1 Library from the VBA
Tools menu
3) Within the macro that performs the merge I have the following (xcfPax is
a view that provides the fields for the merge):
SQLRequest = "select * from xcfPax where matterno = '" & matterRef & "'"

Doc.MailMerge.MainDocumentType = wdFormLetters
Doc.MailMerge.Destination = wdSendToNewDocument

Doc.MailMerge.OpenDataSource _
Name:="", _
SQLStatement:=SQLRequest, _
AddToRecentFiles:=False, _
Connection:="DSN=LFData", _
SubType:=wdMergeSubTypeWord2000

' Execute the mail merge.
Doc.MailMerge.Execute
Doc.MailMerge.DataSource.Close

--
View this message in context: http://postgresql.nabble.com/ODBC-problem-with-Microsoft-Word-and-Excel-tp2189996p5869049.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Vadym Krevs 2015-10-15 12:00:14 SQL_DATA_AT_EXEC processing broken for large objects in nightly git
Previous Message Adrian Klaver 2015-09-30 00:11:28 Re: Issue with TPT and Postgresql ODBC Driver