Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Cannot connect remotely to SQL Server 2005/2008


Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2012, 10:28 AM
Mike Mike is offline
Contributor
 
Join Date: Apr 2001
Location: Montreal, Canada
Posts: 428
Default Cannot connect remotely to SQL Server 2005/2008


Hi folks,

I don't understand what's going on here. I use the following connection code:

Code:
 
    Dim conMasterDB as ADODB.Connection   
    Set conMasterDB = New ADODB.Connection
    With conMasterDB
        .Provider = "SQLOLEDB"
        .Properties("Data Source").Value = MyServer\SQLExpress08        .Properties("User ID").Value = "MyUserID"
        .Properties("Password").Value = "MyPwd"
        .Properties("Initial Catalog").Value = "Master"
        .Open
     End With
And this works fine if I try to connect to my local SQL Server 2008. But if I try to connect from another station on my local area network, with all firewalls down, I cannot connect. Typically, I know that firewalls may block ports 1433 and 1434 to impede a connection, but it can't be the case here because there's no firewall on either side. Can anyone provide any guidance?

Thanks!


Mike
Reply With Quote
  #2  
Old 07-04-2012, 03:46 AM
Orca44 Orca44 is offline
Centurion
 
Join Date: Nov 2004
Location: Cape Town, South Africa
Posts: 124
Default

Can you connect to the remotely using Management Studio?
Reply With Quote
  #3  
Old 07-04-2012, 05:42 AM
DrPunk's Avatar
DrPunk DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,272
Default

SQLExpress by default doesn't allow remote connections. You have to enable them.

With the management studio connected, right click the server in the object explorer and select properties. Then on the Connections page make sure "Allow remote connections to this server" is ticked.

The SQL Browser service can also cause problems if not started by default, but I think that's more of a 2005 issue than a 2008 one.
__________________
There are no computers in heaven!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->