Link to home
Start Free TrialLog in
Avatar of Lynn Thames
Lynn ThamesFlag for United States of America

asked on

Problem connecting to SQL Server 2008 over local connection

I just had SQLServer2008 installed on a computer with Vista Home Premium SP1.  I added a test database with one table and two fields in the table.  

I am trying to test the connection from another computer in our office.   I am using a vb6 program that connects fine to remote SQL Server (I don't know the version number).  The connection string that works for the other SQL Server is:   Provider=sqloledb;Data Source=xx.xx.xx.xx;initial Catalog=mydbname;User Id=myusername;Password=mypassword;

I've tried several variations of connection strings and none of them have worked.

Right now, with this connection string:   "Provider=sqloledb;Data Source=EXCELSS-PC\SQLEXPRESS;Initial Catalog=myTest;User ID=Excelss;Password=popcorn;"

where EXCELSS-PC is the computer name.

I"m getting the following error:

Run-time error '-2147467259 (80004005)':

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

I am guessing that I'm either using the wrong information for datasource, username, and password . . .or there is something going on with the security on the windows side.   From 'Network', I can see EXCELSS-PC and if I double click on it, I can use the username and password above to get to the shared resources (only the printers folder).

Any thoughts?
Dim cn As adodb.Connection
    Set cn = New Connection
 
    cn.ConnectionString = "Provider=sqloledb;Data Source=EXCELSS-PC\SQLEXPRESS;Initial Catalog=myTest;User ID=Excelss;Password=popcorn;"
 
    cn.Open

Open in new window

Avatar of orcic
orcic

try connecting through sql management studio first
Configure the local Windows Firewall on the SQL Server machine to allow traffic to TCP Port 1433. This will enable remote connections to the SQL Server databases.

I am not familiar with SQL Server 2008, but you may have to also configure SQL Server 2008 to allow remote connections. You do this in SQL Server 2005 using the Surface Area Configuration utility
Avatar of Lynn Thames

ASKER

The firewall is turned off and the server is set to allow remote connections.

I don't have sql management studio on any of the other pc's in our office.
ASKER CERTIFIED SOLUTION
Avatar of Lynn Thames
Lynn Thames
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial