Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp not working when moved sql db to backbone from local

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
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:
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
 
onressy,

have a look at this thread:

thread333-1231099

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Something probably needs to change in your ADO connection string... its hard to say what exactly based on the information we have so far... do a google search on connection strings for SQL 2005 and also I would specifically look for anything about connection string changes for non-standard ports since the default for SQL Server is 1433.

Also you might be currently using a named-pipes connection or possibly integrated windows security so it might be an issue of changing to use TCP/IP or SQL Server security.

Too many varibbles to say for sure but just investigate what the connection string SHOULD be for your new database configuration.
 
I also suggest you look at the connection string.

Have a look at:
When you are using a SQL Server on a non-standard port, you can specify the port with the server.

Ex.

"Provider=SQLNCLI;Server=Aron1[!],1344[/!];Database=pubs;UID=sa;PWD=asdasd;"

or

"Provider=SQLNCLI;Server=[!]10.1.1.1,1344[/!];Database=pubs;UID=sa;PWD=asdasd;"

Like I said in the SQL Server forum, make sure that whatever computer is hosting the database, that the firewall is turned off for port 1344.

Also, start up the SQL Server Management Studio.
Right click on the server
Choose Properies
Click the connections tab
Make sure that 'Allow remote connections to this server' is enabled.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
gmmastros, the connection string is correct, I think it may be due to a DSN issue. Thanks for the tips.
 
Did you check the firewall. If you are using port 1344, then the firewall has to allow it (using an exception for that port).

Good luck.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
the setup is like so:
internet--->firewall-192.168...-->webserver-10.10...-->db server.

The db is not on the webserver but in the backbone, so i can't see why the firewall would require port 1344 to be open?
 
Yep, but...

The firewall in your diagram is not the firewall I was referring to. Most machines 'nowadays' have firewall software built in to them. You'll need to get through this firewall anytime you try to access another computer.

From the server (where the db is hosted), go in to your network connections and check the firewall.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
yes the firewall is has been set correctly in the webserver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top