ODBC login fails for not being able to set default database BUT the account can connect to the default via Query Analyzer

  • I have a SQL account whose default db is a user database. The account is on a named instance of SQL 2005, eg. MyServer\Boston. The machine with the ODBC connection is connecting to it via <ipaddress>\Boston, via TCP-IP with a port set 2112.

    I can connect to the ODBC if I set the account to "sa", so I know the server connection info is sound. If I switch to the SQL account, it returns the generic error 4064 SQL Server cannot open user default database. Login failed.

    If I open a query connection to MyServer\Boston, I can connect with the SQL account.

    Why would there be a difference? Note, I cannot connect to the query connection via <ipaddress>\Boston, I get the same message about the default database. I have also tried making its default master, and also giving it the same level of permissions as the sa account.

    Any ideas?

  • I finally figured it out. I ended up creating dummy databases on the two SQL instances and the sa account was connecting to the wrong one. Both had the same port on the firewall and once my OPS guy changed it I was able to connect properly.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply