Wednesday 3 April 2013

"SQL Server does not exist or access denied"

If you are facing

1]Error:- server does not exist or access denied

2]Error :- Changed database context to 'master'

3]SQLSTATE:0012A4D




Try out the following Solutions

1]Check the server name If you are providing this server name as connection string in the program 
then specify

hostname\\sqlexpress; as server name

instead  only hostname or hostname\sqlexpress.


2]Open port through the firewall
          Add port number (1433) and name in firewall

3]Open Run and type cliconfg
            select TCP/IP and enable 






4]Enable TCP/IP port


             Microsoft SQL Server-->configuration Tools-->SQL server configuration Manager










Connection string for the sql server 2008 is as follows





If only TCP/IP protocol is Enabled then provide the following string

"DRIVER={SQL Server};Provider=SQLOLEDB.1;server=hostname\\SQLEXPRESS;DATABASE=Database_name;";


If Shared memory ,Named Pipes are also enabled then

use network=DBMSSOCN; argument in the connection string
"DRIVER={SQL Server};Provider=SQLOLEDB.1;server=hostname\\SQLEXPRESS;network=DBMSSOCN;DATABASE=DatabaseName;


network=DBMSSOCN 


to use the TCP/IP protocol even if the Shared Memory or the Named Pipe protocols are available.





No comments:

Post a Comment

Cool Blue Outer Glow Pointer