Search code examples
windows-serversql-server-2012-express

Using localdb with a computer on a domain but without a connection gives: SQL Server connection error


We expect our software to be able to run on computers connected to a domain. We also expect to be able to connect to a localdb we created under the user account. But when we take the laptop to another network where it can't contact the domain controller we get the following error:

Could not obtain information about Windows NT group/user 'OURDOMAIN\AUser', error code 0x54b.

Is there something I can do to make it work? It seems reasonable to me to expect a domain user's privileges to be remembered when a server is out of sight. Interestingly, if it's not connected to any network it does work ok - it only fails when it is connected to another network.

(I don't want something drastic like "log off and use a local account not on the domain", but something normal and workable for a domain user and installation!)


Solution

  • This error was coming from the simple fact the database owner was the domain user. It would seem that the SQL underlying code likes to check authenticity now and again and so that caused occasional failures in random bits of SQL.

    Fixed it by changing the owner to an SQL user:

    CREATE LOGIN [ourLocalDbOwner] WITH PASSWORD='';
    ALTER AUTHORIZATION ON DATABASE::ourDatabase TO [ourLocalDbOwner];