SQL server [ODBC SQL Server Driver]Cannot generate SSPI context (1 Viewer)

chrisdd

New member
Local time
Today, 00:26
Joined
Jun 25, 2021
Messages
10
I'm using SQL server express 2019 which recently could only be accessed via a VPN.

I'm using a standard ODBC connection string:

ODBC;Driver={SQL Server};SERVER=#######DATABASE=#######;UID=####### ;PWD=#######;

When I first changed the name of the server to connect without the VPN it worked fine but now if I close it and reconnect I see the following message:

SQL server [ODBC SQL Server Driver]Cannot generate SSPI context

Do I need to change the connection string in some way I wonder? Or is this a configuration issue with the server?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:26
Joined
Oct 29, 2018
Messages
18,962
Hi. Welcome to AWF!

How do you VPN to the network? My guess is you would establish a VPN connection first before you could access the server. I don't think you have to change the connection string once you get a VPN connection to the server.
 

chrisdd

New member
Local time
Today, 00:26
Joined
Jun 25, 2021
Messages
10
Hi, thanks!

Sorry should have been a bit clearer - we want to access the SQL server without the VPN which is rather unreliable - I get a couple of the SSPI context messages that I can close and eventually it will access the SQL server and stay connected without the VPN, its all very strange! any suggestions would be very welcome!

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:26
Joined
Oct 29, 2018
Messages
18,962
Hi, thanks!

Sorry should have been a bit clearer - we want to access the SQL server without the VPN which is rather unreliable - I get a couple of the SSPI context messages that I can close and eventually it will access the SQL server and stay connected without the VPN, its all very strange! any suggestions would be very welcome!

Thanks
Interesting. I'm not sure I can help you without being familiar with your company's IT security policies and implementation. Typically, a VPN is established/implemented to ensure security and safety of company IT resources. The fact that you can still access the SQL Server without VPN would be contradicting to that goal. I think the best place to get assistance would be through your IT department. They may have to open up a specific port, outside of the VPN, to give you access to the server without using a VPN. Good luck!
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 09:26
Joined
Jan 20, 2009
Messages
12,490
It is a problem with your Server Principal Name registration.

Check your Kerberos configuration with this tool,
 

chrisdd

New member
Local time
Today, 00:26
Joined
Jun 25, 2021
Messages
10
Hi,
Going to show my ignorance now but presumably Kerberos tool needs to run on the server?

Thanks
 

chrisdd

New member
Local time
Today, 00:26
Joined
Jun 25, 2021
Messages
10
Can I also add a further weird detail and that is, if I go into the front end and manually save a form, the next time I open the database I don't see the SSPI error, but if I then close the front end without saving the form and open it again I get the SSPI error??? I'm very confused!
 

Users who are viewing this thread

Top Bottom