I'm getting "connect failed: OS Error: 'No error'." How do I configure my firewall for use with the Salesforce ODBC driver?

You need to configure your firewall to allow the connection between your application and Salesforce.

If you haven't done this you get:

"connect failed: OS Error: 'No error'"

when you attempt to test or connect to your Salesforce ODBC driver data source.

Assuming that you want to configure your firewall to only allow your ODBC application to connect to port 443 or the Salesforce IP addresses, you need to find out the executable name of this application. Note that the ODBC application is not necessarily the same as the client application that is the ultimate target for your Salesforce data. For example, Microsoft Excel launches another application, Microsoft Query, to connect to and retrieve data from an ODBC data source.

To illustrate the process, here are two Windows examples. The starting point is an active Windows firewall that blocks all outgoing connections.

Example: Configuring the Windows Firewall to allow you to test the ODBC connection to Salesforce

The Salesforce ODBC driver DSN configuration dialog box lets you test the connection to Salesforce. For the test to work through a firewall, you need to add a firewall rule that allows the ODBC Data Source Administrator to connect to either port 443 or the Salesforce IP address ranges. In the Windows Firewall Management Console, create a custom outbound rule that allows drive:\windows\system32\odbcad32.exe (in this example, the 64-bit version of the application) to connect to remote port 443.

Example: Configuring the Windows Firewall to allow SQL Server to connect to Salesforce

For a query running against a linked Salesforce server in SQL Server Management Studio, SSMS is not the relevant application for a Windows firewall rule. To find out the SQL Server application that actually connects to the Salesforce ODBC driver, enable ODBC Driver Manager logging before running the query. (For SQL Server, we recommend that the log file is generated in %WINDIR%\Temp. You may need to restart your instance before SQL Server generates a log file.)

The log file shows that the SQL Server application to specify in the firewall rule is sqlservr:

sqlservr        14cc-604	EXIT  SQLDriverConnectW  with return code -1 (SQL_ERROR)
		HDBC                0x00000000003C7510
		HWND                0x0000000000000000
		WCHAR *             0x000007FEE4A78F08 [      -3] "******\ 0"
		SWORD                       -3 
		WCHAR *             0x000007FEE4A78F08 
		SWORD                       -3 
		SWORD *             0x0000000000000000
		UWORD                        0 <SQL_DRIVER_NOPROMPT>
		DIAG [08001] [Easysoft ODBC-SalesForce Driver]OS Error: 'No error' (0) 

In the Windows Firewall Management Console, create an custom outbound rule that allows drive:\Program Files\Microsoft SQL Server\MSSQLversion.SQLEXPRESS\MSSQL\Binn\sqlservr.exe to connect to the Salesforce IP address ranges. (Convert the IP address ranges from the Classless Inter-Domain Routing (CIDR) notation provided by Salesforce to the notation that the Windows firewall understands.)