Can't connect to foreign SQL Server

They have: 103 posts

Joined: Apr 1999

Ok, I know this is a webmaster forum and this post involves VB, but I think my problem is related to the configuration of SQL Server 6.5.

I have a VB program that connects to an SQL Server database every 5 minutes to check for new records. It's no problem when I try to connect over the network. But when I set the connection to the server's IP address instead of just the server name, it has problems connecting to the SQL Server (says it's not found). I've tried this at different locations inside and outside the network, and all report the same error. Here's my VB code, it really isn't much different from ASP if anyone is familiar with that.

    On Error GoTo LogonError
    
    With CN1
        .Provider = "SQLOLEDB"
        .ConnectionString = "Data Source=myserver;User Id=is;Password=passwd"
        .Open
    End With
'

[Edited by Gil on Dec. 14, 2000 at 12:30 AM]

Gil Hildebrand, Jr.
Internet Consultant
New Orleans, LA

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

may I suggest that someone remove the username/password?
don't want to tempt hackers

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Gil,

Your data source is probably set up to use named pipes. Try configuring it to use TCP/IP and enter the IP number of the server.

They have: 103 posts

Joined: Apr 1999

I wish it was that simple Peter. I'm not using a DSN to connect to the database, just the IP address. I even tried it just now using a DSN, but it gave me a "General network error". Anything else it could be?

Gil Hildebrand, Jr.
Internet Consultant
New Orleans, LA

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

Gil,

Is your SQL Server behind any sort of firewall? Be sure to let requests on Port 1433 through.

They have: 103 posts

Joined: Apr 1999

I've already configured the firewall properly. I'm sure of that...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.