When setting up an ODBC connection to SQL Server Express 2005 across different domains, you're encountering two distinct error patterns:
// Error Pattern 1 (with instance name)
SQLState: '01000' Error: 1326 [DBNETLIB]ConnectionOpen(Connect())
SQLState: '08001' Error: 17 [DBNETLIB]SQL Server does not exist or access denied
// Error Pattern 2 (without instance name)
SQLState: '01000' Error: 14 [DBNETLIB]ConnectionOpen(Invalid Instance())
SQLState: '08001' Error: 14 [DBNETLIB]Invalid connection
Before diving deeper, let's verify the basic connectivity requirements:
// Test basic TCP connectivity (successful in your case)
telnet 123.456.789.012 1433
// Alternative PowerShell test
Test-NetConnection -ComputerName 123.456.789.012 -Port 1433
The critical issue lies in how named instances are referenced via IP addresses. For SQL Server Express, you need to use one of these formats:
// Correct format for IP + named instance
123.456.789.012\SQLEXPRESS,1433
// Alternative format
123.456.789.012,1433\SQLEXPRESS
Here's what needs to be verified on the SQL Server (MYSERVER):
-- 1. Verify SQL Server is configured for remote connections
EXEC sp_configure 'remote access', 1;
RECONFIGURE;
-- 2. Check TCP/IP protocol is enabled
-- (Via SQL Server Configuration Manager → Network Configuration)
-- 3. Confirm SQL Server Browser service is running
-- (Essential for named instance discovery)
While port 1433 is open, named instances often require additional ports:
- SQL Server Browser service uses UDP 1434
- The actual instance might use dynamic ports
Here are proper ODBC connection string formats to try:
// Standard connection string
DRIVER={SQL Server};SERVER=123.456.789.012\SQLEXPRESS;UID=username;PWD=password;
// Alternative with port specification
DRIVER={SQL Server};SERVER=123.456.789.012,1433\SQLEXPRESS;UID=username;PWD=password;
// Using server's FQDN if available
DRIVER={SQL Server};SERVER=myserver.domain.com\SQLEXPRESS;UID=username;PWD=password;
Check the SQL Server error logs for authentication attempts:
-- View recent error logs
EXEC sp_readerrorlog 0, 1, 'login';
Create a client alias using SQL Server Configuration Manager:
- Navigate to SQL Native Client Configuration
- Create a new alias pointing to 123.456.789.012\SQLEXPRESS
- Use the alias name in your ODBC connection
When dealing with cross-domain SQL Server connections, several technical hurdles emerge. In this case, we have:
- A working local ODBC connection using SQL Server Authentication
- A remote machine on a different domain failing to connect via IP address
- Successful telnet verification on port 1433 but ODBC connection failures
The error patterns reveal important clues:
// First error pattern when using IP\Instance
SQLState: '08001'
SQL Server Error: 17
[DBNETLIB]SQL Server does not exist or access denied.
// Second error pattern when using just IP
SQLState: '08001'
SQL Server Error: 14
[DBNETLIB]Invalid connection
Beyond firewall settings, these critical items must be verified:
SQL Server Network Configuration
-- Verify TCP/IP is enabled for the instance
USE master
GO
EXEC xp_readerrorlog 0, 1, N'Server is listening on'
GO
SQL Browser Service Status
For named instances (like SQLEXPRESS), the SQL Browser service must be running on the server to resolve instance names.
Try these alternative connection formats with your ODBC setup:
// Standard format for named instance
Driver={SQL Server};Server=123.456.789.012\SQLEXPRESS;Database=myDB;Uid=myUser;Pwd=myPass;
// Alternative using port specification
Driver={SQL Server};Server=123.456.789.012,1433;Database=myDB;Uid=myUser;Pwd=myPass;
// For scenarios where instance resolution fails
Driver={SQL Server};Server=tcp:123.456.789.012\SQLEXPRESS,1433;Database=myDB;Uid=myUser;Pwd=myPass;
Verify SQL Server Port Binding
-- Check which ports SQL Server is actually listening on
SELECT DISTINCT
local_tcp_port
FROM sys.dm_exec_connections
WHERE local_tcp_port IS NOT NULL
Test with SQL Server Native Client
Sometimes the older SQL Server driver has issues. Try using the Native Client:
Driver={SQL Server Native Client 11.0};Server=123.456.789.012\SQLEXPRESS;Database=myDB;Uid=myUser;Pwd=myPass;
Use these commands to test connectivity beyond simple telnet:
// Test DNS resolution
nslookup MYSERVER
// Test instance resolution (requires SQL Browser running)
sqlcmd -L
// Comprehensive connection test
Test-NetConnection 123.456.789.012 -Port 1433
- Confirm SQL Server is configured for mixed authentication mode
- Verify the SQL login has proper permissions
- Check for aliases in SQL Server Configuration Manager
- Ensure client and server protocols match (TCP/IP)
- Review SQL Server error logs for connection attempts