SQL Server Access/Connection issue

MR BILL 261 Reputation points
2021-02-05T14:11:17.847+00:00

When I install my software on a machine that is connected to a domain, I never have an issue opening my software from a connection string within my software and opening the license table to read the licensekey using the connetionstring through registry settings. When I install on a device not on a domain, the connection to the database to read the license record fails and my app closes without an error. I install SQL server with access both through Windows Auth and SA. Is there some permission issue I am missing somewhere when installing on a device that's not on a domain. Users on the server/database have the setting to connect using sql. I've opened all the necessary ports through the firewall, gave full access to the registry and every folder I can think of to no avail. Any thoughts or ideas on how to solve this issue will be appreciated.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,871 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Michael Taylor 49,076 Reputation points
    2021-02-05T14:53:07.353+00:00

    The error message would help but ultimately it depends upon your connection string. If you put in your connection string "Integrated Security" then it will use Windows auth. Windows auth will use the domain account of the user if on the domain but it'll use the machine name if not. The machine name will generally fail as it is rare to grant a machine access to the DB.

    For non-domain machines you must use SQL auth so your connection string should have a User Id and Password key set to a valid SQL user. Also note that the Database specified in the connection string should be the correct database to connect to.

    1 person found this answer helpful.

  2. MR BILL 261 Reputation points
    2021-02-05T21:10:31.597+00:00

    I didn't really see any error per se: but here is the Error Log
    Express Edition (64-bit) on Windows NT 6.3 <X64> (Build 18363: )

    2021-01-20 12:08:06.40 Server UTC adjustment: -6:00
    2021-01-20 12:08:06.40 Server (c) Microsoft Corporation.
    2021-01-20 12:08:06.40 Server All rights reserved.
    2021-01-20 12:08:06.40 Server Server process ID is 4592.
    2021-01-20 12:08:06.40 Server System Manufacturer: 'Microsoft Corporation', System Model: 'Surface Pro 7'.
    2021-01-20 12:08:06.40 Server Authentication mode is MIXED.
    2021-01-20 12:08:06.40 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL12.My App Name\MSSQL\Log\ERRORLOG'.
    2021-01-20 12:08:06.40 Server The service account is 'NT Service\MSSQL$My App Name'. This is an informational message; no user action is required.
    2021-01-20 12:08:06.40 Server Registry startup parameters:
    -d C:\Program Files\Microsoft SQL Server\MSSQL12.My App Name\MSSQL\DATA\master.mdf
    -e C:\Program Files\Microsoft SQL Server\MSSQL12.My App Name\MSSQL\Log\ERRORLOG
    -l C:\Program Files\Microsoft SQL Server\MSSQL12.My App Name\MSSQL\DATA\mastlog.ldf
    2021-01-20 12:08:06.40 Server Command Line Startup Parameters:
    -s "My App Name"
    2021-01-20 12:08:07.09 Server SQL Server detected 1 sockets with 4 cores per socket and 8 logical processors per socket, 8 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
    2021-01-20 12:08:07.09 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
    2021-01-20 12:08:07.09 Server Detected 15970 MB of RAM. This is an informational message; no user action is required.
    2021-01-20 12:08:07.09 Server Using conventional memory in the memory manager.
    2021-01-20 12:08:07.42 Server Default collation: SQL_Latin1_General_CP1_CI_AS (us_english 1033)
    2021-01-20 12:08:07.99 Server Query Store settings initialized with enabled = 1,
    2021-01-20 12:08:08.05 Server The maximum number of dedicated administrator connections for this instance is '1'
    2021-01-20 12:08:08.05 Server This instance of SQL Server last reported using a process ID of 4164 at 1/20/2021 12:07:41 PM (local) 1/20/2021 6:07:41 PM (UTC). This is an informational message only; no user action is required.
    2021-01-20 12:08:08.06 Server Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
    2021-01-20 12:08:08.08 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
    2021-01-20 12:08:08.11 Server Software Usage Metrics is disabled.
    2021-01-20 12:08:08.13 spid9s Starting up database 'master'.
    2021-01-20 12:08:08.18 Server CLR version v4.0.30319 loaded.
    2021-01-20 12:08:08.33 spid9s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
    2021-01-20 12:08:08.34 Server Common language runtime (CLR) functionality initialized using CLR version v4.0.30319 from C:\Windows\Microsoft.NET\Framework64\v4.0.30319.
    2021-01-20 12:08:08.35 spid9s SQL Server Audit has started the audits. This is an informational message. No user action is required.
    2021-01-20 12:08:08.40 spid9s SQL Trace ID 1 was started by login "sa".
    2021-01-20 12:08:08.41 spid9s Server name is 'CODE2\My App Name'. This is an informational message only. No user action is required.
    2021-01-20 12:08:08.42 spid9s Starting up database 'msdb'.
    2021-01-20 12:08:08.45 spid12s Starting up database 'mssqlsystemresource'.
    2021-01-20 12:08:08.47 spid12s The resource database build version is 12.00.2000. This is an informational message only. No user action is required.
    2021-01-20 12:08:08.48 spid15s A self-generated certificate was successfully loaded for encryption.
    2021-01-20 12:08:08.48 spid15s Server local connection provider is ready to accept connection on [ \.\pipe\SQLLocal\My App Name ].
    2021-01-20 12:08:08.48 spid15s Server local connection provider is ready to accept connection on [ \.\pipe\MSSQL$My App Name\sql\query ].
    2021-01-20 12:08:08.48 spid15s Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated administrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.
    2021-01-20 12:08:08.49 spid15s SQL Server is now ready for client connections. This is an informational message; no user action is required.
    2021-01-20 12:08:08.49 Server SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.
    2021-01-20 12:08:08.49 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/Code2:My App Name ] for the SQL Server service. Windows return code: 0xffffffff, state: 63. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
    2021-01-20 12:08:08.50 spid12s Starting up database 'model'.
    2021-01-20 12:08:08.58 spid12s Clearing tempdb database.
    2021-01-20 12:08:08.70 spid12s Starting up database 'tempdb'.
    2021-01-20 12:08:09.01 spid18s The Service Broker endpoint is in disabled or stopped state.
    2021-01-20 12:08:09.02 spid18s The Database Mirroring endpoint is in disabled or stopped state.
    2021-01-20 12:08:09.04 spid18s Service Broker manager has started.
    2021-01-20 12:08:09.04 spid9s Recovery is complete. This is an informational message only. No user action is required.
    2021-01-20 12:13:26.81 spid51 Starting up database 'My App Name'.
    2021-01-20 12:39:11.02 spid26s Starting up database 'My App Name'.
    2021-01-20 12:39:11.12 spid26s Starting up database 'My App NameAudits'.
    2021-01-20 13:17:10.03 spid38s Starting up database 'My App Name'.
    2021-01-20 18:07:50.97 spid26s Starting up database 'My App Name'.
    2021-01-20 19:32:04.17 spid42s Starting up database 'My App Name'.
    2021-01-21 01:08:17.31 spid22s Starting up database 'My App Name'.
    2021-01-21 01:36:16.57 spid22s Recovery completed for database My App Name (database ID 5) in 1679 second(s) (analysis 2 ms, redo 0 ms, undo 1679120 ms.) This is an informational message only. No user action is required.
    2021-01-21 04:55:48.66 spid35s Starting up database 'My App Name'.
    2021-01-29 12:22:41.13 spid27s Starting up database 'My App Name'.
    2021-01-29 14:19:28.83 spid30s Starting up database 'My App Name'.
    2021-01-29 14:30:19.42 spid52 Starting up database 'My App Name'.
    2021-01-29 14:30:27.61 spid53 Starting up database 'My App Name'.
    2021-01-29 14:30:40.25 Backup Database backed up. Database: My App Name, creation date(time): 2021/01/19(14:24:59), pages dumped: 968961, first LSN: 356:12888:38, last LSN: 356:12984:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'My App NameBackup'}). This is an informational message only. No user action is required.
    2021-01-29 14:30:40.26 Backup BACKUP DATABASE successfully processed 968950 pages in 12.571 seconds (602.173 MB/sec).
    2021-01-29 14:30:40.39 Backup Database backed up. Database: My App NameAudits, creation date(time): 2021/01/19(14:24:59), pages dumped: 8319, first LSN: 76:7088:37, last LSN: 76:7128:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'My App NameAuditsBackup'}). This is an informational message only. No user action is required.
    2021-01-29 14:30:40.40 Backup BACKUP DATABASE successfully processed 8307 pages in 0.116 seconds (559.435 MB/sec).
    2021-01-29 14:30:40.42 spid53 Starting up database 'My App Name'.
    2021-01-29 14:30:40.82 spid53 Attempting to load library 'xpstar.dll' into memory. This is an informational message only. No user action is required.
    2021-01-29 14:30:40.88 spid53 Using 'xpstar.dll' version '2014.120.2000' to execute extended stored procedure 'xp_regread'. This is an informational message only; no user action is required.
    2021-01-29 14:30:53.59 spid53 Attempting to load library 'xprepl.dll' into memory. This is an informational message only. No user action is required.
    2021-01-29 14:30:53.61 spid53 Using 'xprepl.dll' version '2014.120.2000' to execute extended stored procedure 'xp_repl_encrypt'. This is an informational message only; no user action is required.
    2021-01-29 14:30:54.43 spid53 Starting up database 'My App Name'.
    2021-01-29 14:34:45.53 spid52 Starting up database 'My App Name'.
    2021-01-29 14:34:55.34 spid54 Starting up database 'My App Name'.
    2021-01-29 14:35:25.07 spid51 Starting up database 'My App Name'.
    2021-01-29 14:36:27.52 spid51 Starting up database 'My App Name'.
    2021-01-29 14:36:30.22 spid51 Starting up database 'My App Name'.
    2021-01-29 14:37:39.34 spid51 Starting up database 'My App Name'.
    2021-02-02 13:47:45.30 spid22s Starting up database 'My App Name'.
    2021-02-02 17:35:31.82 spid27s Starting up database 'My App Name'.
    2021-02-02 18:28:19.66 spid29s Starting up database 'My App Name'.
    2021-02-02 22:04:48.69 spid24s Starting up database 'My App Name'.
    2021-02-03 02:37:49.26 spid31s Starting up database 'My App Name'.
    2021-02-03 05:26:05.23 spid40s Starting up database 'My App Name'.
    2021-02-05 14:04:58.65 spid22s Starting up database 'My App Name'.
    2021-02-05 14:05:59.42 spid51 Starting up database 'My App Name'.
    2021-02-05 14:08:08.40 spid51 Starting up database 'My App Name'.


  3. Erland Sommarskog 102.2K Reputation points
    2021-02-05T22:38:13.803+00:00

    Did you write this application yourself? In that case, it is time to reach out for that debugger!

    If this is an application that someone else wrote, you will need to talk to the developer or the vendor, so they can dig out what is happening.

    We SQL Server people can make guesses all day, but we are completely in the dark about what your application is doing, so it is unlikely to be accurate.

    You need to get hold of the error the application encounters.