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

SQL Connection

Status
Not open for further replies.

jl280328

Programmer
Jun 15, 2006
97
US
I am trying to connect to a SQL database and am having some trouble here is my connection string, and I am pretty sure the IP address is correct, b/c I am using it to remotely connect to the server that the SQL database resides on. Does anyone have any idea why it cannot connect?
Code:
Conn.Open "Driver={SQL Server};Server=70.90.150.170;Database=ABSOLUTE;Uid=****;Pwd=******;"
 
Try
Code:
Server=\\70.90.150.170;
Normally it uses a URN so by adding \\ it will make the IP address into a URN.
 
Thanks for the reply I tried the \\ in front of the IP but had no luck.
 
Yes I have been through this site already, the connection string that i am using is one from a page that is located on that specific server, I just copied and pasted it to the new page and changed the IP address from the local one to the one I am using to connect to the server remotely. I had it working before from this page, but then the people I am working for made some changes to the server which included a new IP address. I am in a fog as to what I need to do now?
 
Can you connect to that server using SQL server Enterprize Manager?

Sharing the best from my side...

--Prashant--
 
Yes I have been connecting to the server remotely then using the Enterprise Manager to view the database. Is there anything you would like to know to maybe help?
 
Does anything look like it is out of the ordinary with my connection string in the first post of this topic? Are there permissions on the server that would block anything trying to connect to it if it is not coming from a page locally, or could a firewall prevent it form connecting?
 
You need to reference the port at the end of your IP address. So, something like this:
Code:
Conn.Open "Driver={SQL Server};Server=70.90.150.170[COLOR=red],8080[/color];Database=ABSOLUTE;Uid=****;Pwd=******;"

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
I tried the 8080 and figured it wouldn't work and it did not, but I do have access to the server remotely is there some where I Could go to check for an available port that would allow me to connect?
 
I used the 8080 just as an example. Typically, I believe, the port for SQL Server is 1433. Try that and see what happens. Otherwise, I'm not exactly certain how to determine what port it may be using.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
No Luck with 1433, would I have to change something on the server to be able to accept connection string from a particular website?
 
Are you connecting via ODBC or OLE DB? This does appear to make a difference in terms of how you defined your provider. This coming from the site that DotNetGnat pointed you to earlier. Try this and see what happens (it is using OLE DB):
Code:
Conn.Open "Driver=sqloledb;Data Source=70.90.150.170,1433;Network Library=DBMSSOCN;Initial Catalog=ABSOLUTE;User ID=****;Password=******;"

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
I tried that and got a different this time this is what it said
"Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

/Landing.asp, line 142 "

But the IP address for the data source name is the same IP address I use to connect to the server remotely.
 
<tongue-in-cheek> I guess it's too late to ask if you actually have a server name for that server instead of just an IP address... </tongue-in-cheek>

Can you display all of the relevant code for your connection and recordset object(s) as they now stand? That may help us to work through it...

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Where can I find that at I have access to remotely connect to the server?
 
I'm not sure. You might try such a question in forum183.

But I suspect that if you are able to get to the server using EM, then the problem is the way you're attempting to establish your connection in your page, not remotely connecting.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
no I remotely connect to the server then I use the enterprise manager. I don't use the EM to connect to the server.
 
When I right click on the my computer icon on the server itself and check out the properties this is the computer name it shows: server.absoluteinnovations.local
and this is the Domain it shows: absoluteinnovations.local
is their anyway to use either of these it doesn't seem like it with the local attached to it.
 
Do not connect via Remote...From your local machine, goto SQL Server -> Enterprize Manager -> expand Console Root - Come down to SQL Server Group...
Do you have that server registered with you under this group?
If yes...Can you traverse through it's databases?
If No...Try to register that server here and check whether that is giving services to you?


Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top