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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql connection issue

Status
Not open for further replies.

aspnet98

MIS
May 19, 2005
165
0
0
US
Hello,
I am using the following connection string on my hosted website plan:

dim DbConn
Dim dbDir
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.ConnectionTimeout = 0
dbConn.CommandTimeout = 0
DbConn.Open("DRIVER={SQL Server};SERVER=xx.xx.xx;DATABASE=test;UID=tes;pwd=test;")

When I try to switch the connection string to a different sql server (I purchased a dedicated server from another hosting company with a static ip address no dot.com name) it just hangs? It works fine if I use the other servers dedicated web server to connect to the sql db.

For example:
testing.com
sql server (on the static ip from another host)
The above fails...

68.xx.xx.xx (static site's webserver)
static sites sql db
the above connection string works because on same server i guess?

The issue has something to do with being on different servers I guess? I tried a ton of different connection strings for remote sql servers but they all failed.

any ideas? remember the connection string works perfectly if on the same server so please do not post about the status of the db because that works.

thanks,
aspnet98
 

What about:
Code:
dim DbConn
Dim dbDir
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.ConnectionTimeout = 0
dbConn.CommandTimeout = 0
DbConn.Open("Provider=sqloledb;Data Source=xx.xx.xx;Initial Catalog=pubs;User Id=tes;Password=test;")


Borislav Borissov
 
BB
Same result, it just hangs....

This is so frustration because it works perfectly while on the same server? There has to be something wrong somewhere with my code...
 
If you can connect by IP but not by name, it most likely is an issue with the DNS Server not doing name resolution. If it's not set up to do name resolution, you will have to use the IP address.

If that's not the problem and it's just that you can't connect to a server other than the one you are on, my quess would be that you are using Windows authentication and the two different servers are not part of a trusted network.

-SQLBill

Posting advice: FAQ481-4875
 
my server does not have a name it is just an ip address. i do not understand that full the dns server stuff you mentioned.

how do i get it to authenticate via SQL so this is not an issue?
 
Are you sure that TCP/IP is enabled as protocol on that server? May be just named pipes is enabled.


Borislav Borissov
 
The type of login used is set on the SQL Server system. The instance must be set to use Mixed Mode authentication and your login on SQL Server must be set to use SQL Server authentication.

-SQLBill

Posting advice: FAQ481-4875
 
tcp/ip has to be because it works perfeclty on the same server. can you suggest anymore connection strings?
 
I'm beginning to think it might be a firewall issue. What port is being used for SQL Server (default is 1433). Is that port open on the firewall?

What errors are showing up on the Server (Windows Event Viewer Logs) and SQL Server (Error Logs).

-SQLBill

Posting advice: FAQ481-4875
 
The dedicated server has no firewall.

The web server may.

I did a netstat -an and do not see 1433 listening but it says it is set in sql server manager.
 
You have to allow outgoing connections from your web server and allow incoming connections on your DB server on the relevant ports.
 
I would assume that ports are being blocked somewhere along the line. Perhaps one of the hosting companies is blocking the connection.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
:( You guys are right. They told me they do not allow these connection to be done on the web server i am hosted by. Man that stinks, anyway around that?

I have a domain and need to migrate to a dedicated server i just bought through another company. it is setup and redundant with the existing live site.

How do I transfer the Name to the second IP address then direct everyone there until i can cancel the other service?
site name Ip address 68.XX.XX.XX (new dedicated server)

What is the best way to do this without my endusers knowing?

Thanks again for everyones' help.
 
First, who OWNS the name? If the hosting company owns the name, then you might not be able to transfer it.

Next, I would check the license agreement with the original hosting service. They may have a clause that you agreed to not move your stuff to another company's equipment.

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top