Saturday, February 25, 2012

Connection error : SQL Server does not exist or access denied

hello , i'm very new to sql server.

i'm using sql server 200 & winXP. I have a local server called "JO" and a dsn named "LocalServer".

Authentication is sql server authentication & window with username of "cying" and password "admin"

i can ping my server "JO" but cannot telnet it's sql_server_tcp_port.

this is the error code i obtained when try to open the connection:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.

my connection string is as below :

set objcon = server.CreateObject("ADODB.Connection")

strConnection = "Provider=MSDASQL;Driver={SQL Server};Server=local;Data Source=LocalServer;User ID=cying;Password=admin;Persist Security Info=False"

objcon.open, strConnection

is there anything wrong with my connection string or setting?

pls help, thanks in advance


ok, i can now connect to sql server but another error occurs:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'Provider=MSDASQL'.

my connection string is as below :

strConnection = "Provider=MSDASQL;Driver={SQL Server};Server=(local);User ID=cying;Password=admin;Persist Security Info=False;"

do i need to put in data source? i created the user id under enterprise manager, (local) > serucity > logins. server access is set to permit. i even try log in with sa account but still comes out the same error.

pls help, thank u

|||

Hi,

It looks like you're running into a known problem described in the BOL (http://msdn2.microsoft.com/en-us/library/ms190204.aspx):

Note:

To enhance security, SQL Server 2005 disables TCP/IP connectivity to SQL Server 2005 for new installations of the Developer, Evaluation, and SQL Server Express editions. OLEDB applications connecting with MDAC 2.8 cannot connect to the default instance on local server using ".", "(local)", or (<blank>) as the server name. To resolve this, supply the server name, or enable TCP/IP on the server. Connections to local named instances are not affected, and connections using SQL Native Client are not affected. Installations where a previous installation of SQL Server is present might not be affected.

Try changing "(local)" to the name of the server.

Il-Sung.

|||

i manage to connect to db finally after changing the code, here's my new connection string

strConn = "Provider=MSDASQL;Driver={SQL Server};server=(local);uid=cying;pwd=admin;database=cying"

II-Sung, i'm using sql server 2000 and hav TCP/IP enabled

i think the cause of problem is uid & pwd, previously i used user name & password and failed to establish a connection

thanks for ur help though =)

No comments:

Post a Comment