“Cannot Create SSPI Context” and how to fix it

Just a quick note for anyone who has ever gotten this error before: “Cannot create SSPI context”. I started getting this error when I was trying to establish a connection to a SQL Server when I wasn’t connected to the internal Microsoft corporate network. Connection strings that worked just fine when I was connected just wouldn’t work at all, and I could not figure out how to fix it.

GIYF (Google Is Your Friend) I googled it and found out that I had my connection string set wrong. I was using localhost for the server name in the connection string, which is not correct. I needed to use the SQL Server name, not the hostname.

So I changed the server to brian-thinkpad, my machine name, and everything worked just fine.

Hopefully this will save someone else the hour or so of confusion I spent trying to fix this.

— bab

 

10 thoughts to ““Cannot Create SSPI Context” and how to fix it”

  1. This will also happen if you are logged into your machine for days or weeks at a time and your password has expired. The PDC knows your password has expired, but your machine doesn’t. So when Sql Server goes to authenticate you, you will fail due to password expiration on the domain account, thus receiving the error you mentioned above.

  2. http://site.voila.fr/ku19826/nvmingxing.htm ???????

    http://site.voila.fr/ku19826/xinfeng.htm ?????

    http://site.voila.fr/ku19826/shunv.htm ????

    http://site.voila.fr/ku19826/nvxingxb.htm ????????

    http://site.voila.fr/ku19826/qiantai.htm ????????

    http://site.voila.fr/ku19826/gglldd.htm ????

    http://site.voila.fr/ku19826/touming.htm ?????

    http://site.voila.fr/ku19826/qingsdy.htm ????

    http://site.voila.fr/ku19826/sanjipian.htm ???

    http://site.voila.fr/ku19826/jiqxisho.htm ????

    http://site.voila.fr/ku19826/jiqingying.htm ????

    http://site.voila.fr/ku19826/xingzhan.htm ????

    http://site.voila.fr/ku19826/xintu.htm ????

    http://site.voila.fr/ku19826/xingd.htm ????

    http://site.voila.fr/ku19826/ct.htm ????

    http://site.voila.fr/ku19826/cx.htm ????

    http://site.voila.fr/ku19826/crz.htm ????

    http://site.voila.fr/ku19826/cdy.htm ????

    http://site.voila.fr/ku19826/st.htm ????

    http://site.voila.fr/ku19826/sqs.htm ????

    http://site.voila.fr/ku19826/szz.htm ????

    http://site.voila.fr/ku19826/syyy.htm ????

    http://site.voila.fr/ku19826/huangtt.htm ????

    http://site.voila.fr/ku19826/hhhz.htm ????

    http://site.voila.fr/ku19826/hhdd.htm ????

    http://site.voila.fr/ku19826/hhyy.htm ????

    http://www.liberalforum.org/blog/?u=nxiong ????????

    http://www.liberalforum.org/blog/?u=tttmmm ?????

    http://www.liberalforum.org/blog/?u=sssnnn ????

    http://www.liberalforum.org/blog/?u=qqqjjj ????????

    http://www.liberalforum.org/blog/?u=ngyngy ???????

    http://www.liberalforum.org/blog/?u=gugu8 ????

    http://www.liberalforum.org/blog/?u=xxxyyy ????

    http://www.liberalforum.org/blog/?u=cccyyy ????

    http://www.liberalforum.org/blog/?u=hhhyyy ????

    http://www.liberalforum.org/blog/?u=jjjyyy ????

    http://www.liberalforum.org/blog/?u=hhhzzz ????

    http://www.liberalforum.org/blog/?u=jjjzzz ????

    http://www.liberalforum.org/blog/?u=sssyyy ????

    http://www.liberalforum.org/blog/?u=hhhsss ????

    http://www.liberalforum.org/blog/?u=ssszzz ????

    http://www.liberalforum.org/blog/?u=ssssss ????

    http://www.liberalforum.org/blog/?u=xxxsss ????

    http://www.liberalforum.org/blog/?u=ccczzz ????

    http://www.liberalforum.org/blog/?u=cccsss ????

    http://www.liberalforum.org/blog/?u=xxxzzz ????

    http://www.liberalforum.org/blog/?u=sssjjj ???

    http://www.greatestjournal.com/users/ccblog/311.html ???

    http://www.greatestjournal.com/users/ccblog/570.html ????

    http://www.greatestjournal.com/users/ccblog/993.html ????

    http://www.greatestjournal.com/users/ccblog/1221.html ????

    http://www.greatestjournal.com/users/ccblog/1522.html ????

    http://www.greatestjournal.com/users/ccblog/1642.html ????

    http://www.greatestjournal.com/users/ccblog/1940.html ????

    http://www.greatestjournal.com/users/ccblog/2124.html“>http://www.greatestjournal.com/users/ccblog/2124.html ????

    http://www.greatestjournal.com/users/ccblog/2124.html“>http://www.greatestjournal.com/users/ccblog/2124.html ????

    http://www.greatestjournal.com/users/ccblog/2796.html ????

    http://www.greatestjournal.com/users/ccblog/3062.html ????

    http://www.greatestjournal.com/users/ccblog/3229.html ????

    http://www.greatestjournal.com/users/ccblog/3577.html ?????

    http://www.greatestjournal.com/users/ccblog/3658.html ??? ????

    http://www.greatestjournal.com/users/ccblog/3907.html ????

    http://www.greatestjournal.com/users/ccblog/4174.html ????????

  3. Another thank you for sharing this information and to Raymond too. Raymond’s description was the reason we were getting this error.

  4. Hi,

    I got this error message while I tried to establish connection using DSN which was created using my domain account. Since my password was expired I got this error message. Now this forum helped me to resolve this.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.