ASP Forum
SQL server access, error......
phobos | Posted 11:52pm 12. September 2005 Server Time |

Im trying to connect to database but im allways getting an error.

DATA_SOURCE = "MsDataLab"
DATABASE_NAME = "database"
USER_ID = "user"
PASSWORD = "userpass"

Set mConn = Server.CreateObject("ADODB.Connection")
mConn.Open "PROVIDER=SQLOLEDB;DATA SOURCE="& DATA_SOURCE &";DATABASE="& DATABASE_NAME &";USER ID="& USER_ID &";PASSWORD="& PASSWORD &";Packet Size=32767"    
strDB = "SQL: " & DATABASE_NAME

All data is corect. With other programs i can access SQL server.


Im geting the error below:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

ANY IDEA?
ashok_19 | Posted 3:11pm 14. September 2005 Server Time |

Set dataConn=Server.CreateObject("ADODB.Connection")
strConn = "Driver={SQL Server};" & _
           "Server=MsDataLab;" & _
           "Database=database;" & _
           "Uid=user;" & _
           "Pwd=userpass"
  
dataConn.open(strConn)

Try this. Is the db on the same machine, or different. Make sure you have a connection set if it is on the same machine if remote then use the sql server ip address or name. Good luck.
phobos | Posted 5:52am 15. September 2005 Server Time |

Server is on the other machine, im conecting to server trough DSN
khadija | Posted 8:55pm 24. August 2008 Server Time |

hii,
I am doing a remote connection with another PC as that being the Server and my PC being the client and both the computers are in a network.

I did all this Configuring Microsoft SQL Server Express connection for remote excess from the help from this website:
http://www.entiretech.co.nz/articles/showarticle.aspx?ID=2

At first i only did it for my PC as i am the Client, but it didn't work so i did for the Server PC which is the remote computer.

this is the connection String i used in my VB.Net 2005 that is :

Dim conn As New SqlConnection("Data Source=XXX.XXX.XXX.XXX,XXXX;Network=dbmssocn;initial catalog= MCTS,Integrated Security=True")

but now the error which is gives is that:

" Login failed for user ''. The user is not associated with a trusted SQL Server connection."

I really need your help in this. thank you.

Khadija
probinu | Posted 5:41am 26. August 2008 Server Time |

The user of the client machine (the username that you logged in as) does not have the correct access set for the DB.  If you are using a stored procedure you need to grant execute permissions to your user.  If it is  asql query you need to grant rights to the DB.


Reply to Post SQL server access, error......



Back to Forum Page