Microsoft KB Archive/234736

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

Article ID: 234736

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q234736



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 that this is a problem in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug kbpending KB234736

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.