|
 |
asp_databases thread: [Microsoft][ODBC SQL Server Driver][SQL Server] database connection
Message #1 by Wendy_wang@m... on Wed, 31 May 2000 16:29:34
|
|
I have the following :
<%
strServerName = Request.Form("ServerName")
SQL = "SELECT * FROM SRV_System_Info WHERE ServerName ="'& strServerName
&'""
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "Mydatasource"
Set objCommand = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnection = objConnection
RS.Open objCommand,,adOpenForwardOnly,adLockReadOnly
%>
And I got the following error message:
"Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '\'.
/es3/MupdateSysInfo.asp, line 22 "
When I give the UID=MyUID;PWD=MyPWD which is in my global.asa":
<%
strServerName = Request.Form("ServerName")
SQL = "SELECT * FROM SRV_System_Info WHERE ServerName ="'& strServerName
&'""
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "MyDataSource;UID=MyUID;PWD=MyPWD"
Set objCommand = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject("ADODB.Recordset")
objCommand.CommandText = SQL
objCommand.CommandType = adCmdText
Set objCommand.ActiveConnection = objConnection
RS.Open objCommand,,adOpenForwardOnly,adLockReadOnly
%>
Then I got this:
"Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified
/es3/MupdateSysInfo.asp, line 22 "
Does anybody have any idea about this? Any suggestion will be appreciated.
Wendy
|
|
 |