Bug #63844 Crash in SQLSetConnectAttr
Submitted: 22 Dec 2011 20:21 Modified: 16 Jul 2013 22:39
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1.9 OS:Microsoft Windows (Windows 7 64-bit)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: regression

[22 Dec 2011 20:21] [ name withheld ]
I recently built a new system and moved to the 5.1.9 version of Connector/ODBC.  When attempting to do a mail merge with a Work document that worked fine on the old system, myodbc5.dll failed as described in the following information from the event log:

Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P2: 14.0.6024.1000
P3: 4d83e2f6
P4: myodbc5.dll
P6: 4e8b6a8e
P7: c0000005
P8: 00000000000247b3

The basic "Test connection" works, but when I attempt to actually pull data, this failure occurs.

I was able to successfully do this connection by copying the 5.1.8 version of myodbc5.dll from another system.

How to repeat:
Create a Data Source in Windows.

Open Winword and start a mail merge.  Follow the dialog to create a data connection using the data source created above.  At the last step where you click Finish, a popup will appear saying that the connection could not be complete due to a catastrophic failure opening the data connection.
[23 Dec 2011 14:50] Valeriy Kravchuk
What exact server version, x.y.z, are you working with? Is it 32-bit or 64-bit Connector/ODBC?
[23 Dec 2011 15:57] [ name withheld ]
Sorry, should have included that information...

Server is 5.1.49 running on a Synology NAS box.

Connector is 64-bit, as is Word.
[3 Jan 2012 6:02] Bogdan Degtyariov
Sorry, mail merging in MS Word is not something we do every day.
So, we would appreciate a bit more guidance from you.
At which step am I supposed to specify the ODBC connection?
It is not obvious and default choices in the Mail Merge Wizard do not prompt for any connections.
[3 Jan 2012 7:24] [ name withheld ]
I understand.  Here's how I can recreate the problem.

First, create an ODBC DSN pointing to the database and table you want to use for the merge.

Open Word 2010 in an empty or new document.  (These instructions won't work in previous versions of Word.  The mail merge process was completely different in those versions.)
Click on Mailings on the menu.
Click on Select Recipients in the ribbon, and pick Use Existing List.
When the Select Data Source window comes up, click on the New Source Botton toward the bottom.
When the Data Connection Wizard opens, pick ODBC DSN as the type of data source and click Next.
Choose the DSN that you created above, and click next.
You will get a Select Database and Table window that has the information from the DSN filled in.  Click Next.
The Save Data Connection File and Finish Windows comes up.  Click Finish.
A Data Link Properties window pops up.  In part 1, click on Use data source name and select the DSN you created previously.  If you then click on Test Connection, you'll get an error window that says "Test connection failed because of an error in initializing provider.  Catastrophic failure"

If you look in the Application event log, you'll see the failure.

Simple procedure, eh?

Hope this helps.
[11 Jan 2012 8:35] Bogdan Degtyariov
Thank you for clarification.
The bug is repeatable, so I am setting "Verified" status.
[10 Aug 2012 17:39] [ name withheld ]
FWIW, this problem still occurs in the 5.2.1 beta.
[21 Mar 2013 8:02] Bogdan Degtyariov
The driver crashes because of calling SQLSetConnectAttr(hdbc, SQL_ATTR_CURRENT_CATALOG, ...) before SQLDriverConnect().

Repeatable with 5.2.4 too.
[21 Mar 2013 11:26] Bogdan Degtyariov
Patch and test case

Attachment: bug63844.diff (application/octet-stream, text), 3.45 KiB.

[22 Mar 2013 8:17] Bogdan Degtyariov
The patch is pushed:

v5.2.5  revision 1134
v5.1.13 revision 1092
[16 Jul 2013 22:39] Daniel So
Added an entry to Connector/ODBC 5.2.5 and 5.1.13 changelogs:

A data connection could not be opened in Microsoft Word 2010 for mail merges that attempted to use an ODBC DSN.