BUG: SQLDMO - Query Analyzer May Fail to Connect if SQL Server is Started as Part of Connection AttemptID: Q234736
|
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:
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: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.
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( )).
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.
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
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