none
how to remote connection to an SQL server on the same network?

    Question

  • hi
    i added 2 databases to my SQL server on a machine next door using Microsoft SQL server management studio express... I made sure that the server allows remote connection

    then from this computer i pass a connection string to my SQLCLient in VB2005 that looks a bit like this
    Code: ( text )
    1. ConnString = "Server=USER-PTDH8Z5ESH\SQLEXPRESS;Database=FSS.MDB;Trusted_Con  nection=True;User Instance=True"



    for which it gives me this error when i open the connection
    SQLConnecton.Open()

    System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
    at System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
    at System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
    at System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at Flying_School_Scheduler.DBEngine.StartConnection() in





    whats the big idea?
    i'm in a bit of a tight schedule here... can anyone help me here? ??
    Monday, July 02, 2007 2:15 PM

Answers

All replies

  • First, let me express my aplogies for not getting to your question sooner. It would be not too trite to say that since most of us that take our time to respond to questions such as yours, are volunteers, and we are often also on a tight schedule. Simple, straightforward requests for assistance are looked at and perhaps even responded to far sooner than demanding, whining ones...

     

    As to the 'big deal' with your connection string: There are a couple of possibilites:

     

    • Often using 'prohibited' characters in a server name requires extra handling, such as enclosing the name in square brackets. You might try:
      Server=[USER-PTDH8Z5ESH\SQLEXPRESS];
    • Is the database itself named FSS.MDB, or could that, by mistake, be the database file name?
    Monday, July 02, 2007 3:08 PM
  • Normally, error 26 is caused by a few common problems that are easily fixed.  Please take a look at this posting as it should probably fix your problem: http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx

     

    Thanks,

    Il-Sung.

    Monday, July 02, 2007 5:38 PM