PRB: SQL Server Error 911: Invalid Database Name

Last reviewed: April 18, 1995
Article ID: Q115424
The information in this article applies to:
  • Microsoft FoxPro Connectivity Kit, versions 2.5, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.5, 2.5a, 2.5b, 2.6

SYMPTOMS

When you are trying to connect to a server in FoxPro for MS-DOS using the Connectivity Kit, the error below is received:

   SQL Server error 911: Invalid database name

CAUSE

The DBConnect() documentation on page 32 of the FoxPro Connectivity Kit "User's Guide" says the following:

   In FoxPro for MS-DOS, specify a database name on SQL Server with
   <expC4>.

The DBConnect() function has the following format

   DBConnect(<expC1>,<expC2>,<expC3>,<expC4>)

where:

   <expC1>  Data source name
   <expC2>  User Identifier
   <expC3>  Password
   <expC4>  Database name (in FoxPro for MS-DOS only)

The error occurs when the fourth parameter (<expC4>), the Database name, is not a valid database name.

For example, the code below will cause the error to occur because the database named "JUNK" does not exist. REDDFOXX is a valid server name, sa is a valid user name, and "" is a valid password.

   errmsg=""
   errval=""
   handle=DBConnect("REDDFOXX","sa","","JUNK")
   =DBError(0,@errmsg,@errval)
   ?errmsg
   ?errval

RESOLUTION

Change the fourth parameter in the DBConnect() function to a valid database name.


Additional reference words: FoxDos 2.50 2.50a 2.50b 2.60 SQLSERVER CK
errmsg err
msg
KBCategory: kbinterop kbtool kbprg kberrmsg kbprb
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 18, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.