BUG: SQLDMO - Query Analyzer May Fail to Connect if SQL Server is Started as Part of Connection Attempt

ID: Q234736


The information in this article applies to:

BUG #: 55818 (SQLBUG_70)

SYMPTOMS

If SQL Server is started from Query Analyzer with the option "Start SQL Server if stopped", the connection may fail. The error that occurs is:

Unable to connect to server 'server name'
Server:Msg 6, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL Server not found.
Similarly, from a SQL Distributed Management Objects (DMO) program when Start is used with StartMode = TRUE to make a connection after a successful start, it may fail with this error:
Runtime error '-2147221504' ( 80040000 )
[Microsoft][ODBC SQL Server Driver][Named Pipes]Specified SQL Server not found.
[Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen(CreateFile( )).


CAUSE

If SQL Server needs to create or relocate a large .mdf or .ldf file at startup (for example tempdb.mdf is deleted), the connection attempt is made before SQL Server is fully started resulting in the error.


WORKAROUND

Attempt the connection again from Query Analyzer.

For SQL Distributed Management Objects (DMO) applications do not use StartMode = TRUE. Instead try connecting after SQL Server is started.

Sample code:


With HostSQLServer
    
  If Not .VerifyConnection(SQLDMO.SQLDMOConn_CurrentState) Then
            
    If .LoginSecure Then
      .Connect .Name
    Else
      .Connect .Name, .Login, .Password
    End If
  End If

End With 


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.

Additional query words:


Keywords          : kbSQLServ700bug 
Version           : winnt:7.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: June 22, 1999