Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random "Sql server error" 18452

Status
Not open for further replies.

ykfc

Programmer
Mar 6, 2004
66
AU
We run client application (in VBA), accessing a SQL 2k Database via odbc. SQL server security accepts authentication in mix modes (both sql authen. and Windows authentication.)

Our odbc DSN configuration is setup to use Windows authentication.

Our applications run fine most 98% of the time. However, ~4 times in a day it comes up the thing: "SQL server error 18452. Login failed for user '(null)'. Not associated with a trusted SQL Server connection". Then came a dialog box to reconnect using Windows Authentication, while the text box for entering "sql server login name/password" was greyed out.

That was random!! Associated with various application attempting to connect to SQL via odbc. Our Windows login has definitely the correct permissions setting to access the required database(s) in question, as it works all the time at the same command line but only fails occasionally.

Well if the error comes up, we have no other solutions but to stop and re-start the SQL server and SQL Server Agent Sevices. Then restart our client application (data loss), and so far, it always runs again.

I'm not too sure if the following ONE event log entry (found in the machine runnning the application & at time of failure) helps or not:
Type: Warning
Source: LicenceService
User: N/A
Computer: <machine name running the application>
Description: Replication of licence information failed because the Licence Logging Service on Server <DomainServerName> could not be contacted.

What is happening? I read this forum. The closest information I have is from

But I couldn't ask someone to promote our SQL server as a domain controller without good reasons and I am not too sure if it helps.

Also, I think there is another solution but not 100% sure. What are your comments: if I modify the application and force it to connect with SQL server authentication. I think the error message 'Not associcated with any trusted connection' only comes up with Windows authentication but never with SQL server authentication. Can someone confirm?
 
Regarding the License Error message:

Have you verified with your network people that all the licenses running currently are actually valid? It could be some other program is interfering with SQL being able to run.

Regarding the User(Null) error for SQL:

Is this error occuring when a specific user OR specific machine tries to access SQL? I would monitor that. It seems like a valid user login isn't being passed properly between Windows/AD and SQL. Also, verify that SQL Server and all its associated Services are running in the same account. Check the Administrative Tools -> Services on the actual SQL machine to verify this.

Someone might actually be trying to log in with an invalid account, by accident or on purpose.



Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
Thank you for offering effort to help.

1) Your comment with "License Error message" drive me to read that error more carefully.

Assume the SQL SERVER is in machine/box SSS, our Domain Controller is DDD, our Client application runs in machine CCC.

I re-quote the event log in CCC as I am not sure if something is missed.
Type: Warning
Source: LicenceService
User: N/A
Computer: <CCC>
Description: Replication of licence information failed because the Licence Logging Service on Server <DDD> could not be contacted.

CCC is the machine name where a client application tries to access the SQL data via odbc. CCC is our Domain Controller name.

If it is a issue with valid/invalid licence, do you point to SQL licence or any other program licence? Maybe we need a look.

2)[Is this error occuring when a specific user OR specific machine tries to access SQL?] I don't think we need to monitor this. This is always the same Windows user ( to run the program. All the programs are running on the same machine too (all via a automated tasks).

3)[It seems like a valid user login isn't being passed properly between Windows/AD and SQL.] I agree. But why and why the error randomly occurs, though very infrequent.

4) [Also, verify that SQL Server and all its associated Services are running in the same account] Both the MSSQLSERVER and SQLSERVERAGENT services are started automatically when SSS starts up and logon as which is the same username that runs the client application in machine CCC. So appears to me it doesn't explain the errors we have.
 
Windows Server 2k & 2k3 has its own Licensing Module that controls all MS related software licenses. Honestly, having never used it, I'm not sure of the details. I just know it exists. It could be your PC is having severe communications errors with the DC. I'd check with Microsoft (lookup your Server OS) on this tool.

As far as not monitoring whether or not it is a specific machine or all machines with this problem, are you saying you've only got 1 PC that uses this connection? If you have more than 1 PC that uses the connection, regardless of using the same windows login, there may be other issues at work, such as Trusted Connections/Network Subnets/etc. Hence the reason I asked the question to begin with. If you could clarify your response to that question, I would appreciate it.




Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
This error is one I get very infrequently on one of my applications (albeit one used by multiple users on multiple machines). In every case it is due to a problem with the user's Windows account - either their password has expired mid-session or the account has been locked out.

What the error basically means in effect is that the user is currently not logged on properly to the machine. Therefore he has no Windows security context to pass to SQL Server (hence the windows user being NULL in the error).

In all cases, when the user logs off Windows and tries to log on again, they will get an error saying what the problem is. Fix that, log back on and the app is fine again.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top