Why does a DBI ODBC connection tell me CoInitialize has not been called?

1

I'm connecting to an Azure SQL box, and have not had issues with it for months. Today, I get this error:

Error: nanodbc/nanodbc.cpp:983: FA004: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server][Failed to authenticate user '' in Active Directory (Auth option is 'Active Directory Integrated')
Error code 0x800401F0; state 10
CoInitialize has not been called.

The error code seems to be something with COM in Windows.

I guess what I'm asking is this: Does this error stem from an issue in R, or an issue with permissions in Azure?

r
sql-server
azure
dbi
asked on Stack Overflow Jan 2, 2020 by Ryan Coots

2 Answers

1

For those that stumble on this, I needed to update base R and install the requisite packages (DBI). That seemed to fix the error.

answered on Stack Overflow Jan 2, 2020 by Ryan Coots
0

Edit: Uninstalling and Reinstalling the DBI package (ver 1.1.0) got it working again.


I'm still fighting the exact same error message myself, connecting to Azure Sql Server using Azure Active Directory Integrated Authentication. Running Windows 10.

Getting same error as OP, upgraded drivers & libraries, rebooted. For a few hours it did work, now back to this same error. I can connect with SSMS. I can do "Test Connection" in the ODBC and it works.

The fact that it worked for a little while is really throwing me, like something timed out somewhere?

ODBC Driver 17 for SQL Server, version 2017.174.02.0 R (base): 3.6.2 odbc: 1.2.2 DBI: 1.1.0

Any ideas about what to look for or try greatly appreciated!

p.s. Not sure if best practice is to create new question or add on to this on. Since my error message is identical, I didn't want to create a duplicate either :-/

answered on Stack Overflow Jan 16, 2020 by Wilmo • edited Jan 16, 2020 by Wilmo

User contributions licensed under CC BY-SA 3.0