Hi, i hve a web application that use to connect to a sql2000 db that was local to the web server. I would connect like so:
Since i move the sql 2k db from local to a sql2005 db on a dot 10 backbone, I cannot seem to connect to the database. The backbone sql2005 is on port1344. I made sure the sql2005 user retained permissions from the 2k sql, so all is mirrored correctly. What would i need to connect to the new sql2005 on the backbone? The error i'm getting is Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login 'me_com'. Login fails.
/system/database.asp, line 48
Thanks,
Jason
Code:
Sub SetConnections()
Dim oXMLApplicationConfig, oODBCConnectionNode
Set oXMLApplicationConfig = Server.CreateObject("Msxml2.DOMDocument.3.0")
oXMLApplicationConfig.Load (SystemConfigFile())
Call oXMLApplicationConfig.setProperty("SelectionLanguage", "XPath")
Set oODBCConnectionNode = oXMLApplicationConfig.selectSingleNode("//ApplicationConfig/Connection")
ODBC_CONNECTION = oODBCConnectionNode.text
Set oODBCConnectionNode = Nothing
Set oXMLApplicationConfig = Nothing
End Sub
Sub AcquireConnection
Call SetConnections()
'Attempts to open a connection to the database specified in the connection string
'This procedure requires that a System DSN be created on the web server
'If the connection fails then the site is redirected to a maintenance page
Dim sMaintenancePage
'On Error Resume Next
sMaintenancePage = "maintenance.asp"
'<Create New Connection Object/>
Set objConn = Server.CreateObject("ADODB.Connection")
'<Attempt to Open the ODBC Connection/>
objConn.Open ODBC_CONNECTION
'<DatabaseNotFound/>
If objConn.State <> 1 Then
Response.Redirect MaintenancePage & "?err=1"
End If
End Sub[code]
so i could usew a stored procedure, something like so:
[code]
Public Sub UpdatePassword(UserID, Password)
Call AcquireConnection
Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "s_UpdatePassword"
objCmd.CommandType = adCmdStoredProc
objCmd.Parameters.Append objCmd.CreateParameter("UserID", adInteger, adParamInput,, UserID)
objCmd.Parameters.Append objCmd.CreateParameter("Password", adVarChar, adParamInput, len(Password), Password)
objCmd.Execute, , adExecuteNoRecords
Set objCmd = nothing
Call ReleaseConnection
End Sub
Since i move the sql 2k db from local to a sql2005 db on a dot 10 backbone, I cannot seem to connect to the database. The backbone sql2005 is on port1344. I made sure the sql2005 user retained permissions from the 2k sql, so all is mirrored correctly. What would i need to connect to the new sql2005 on the backbone? The error i'm getting is Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login 'me_com'. Login fails.
/system/database.asp, line 48
Thanks,
Jason