BUG: ODS App. GP Fault when SQL Admin Runs Full DB Properties

ID: Q119626


The information in this article applies to:

BUG# NT: 867 (4.2)

SYMPTOMS

An Open Data Services application will general protection fault (GP fault) with a stack overflow when a user selects Manage, Database, Properties, Full from the Database Management window in SQL Administrator.


CAUSE

When a user selects Manage, Database, Properties, Full from the Database Management window, SQL Administrator examines the allocation pages directly to determine exactly how much space is available in the database. Open Data Services was not intended to process this kind of request.


WORKAROUND

If a user needs to use the Full Database Properties function of SQL Administrator, the user must not connect though the ODS application, but should connect directly to the SQL Server. To prevent the ODS Application from having a GP fault, code must be added to check for the language event caused by this action.

In the language event handler, if a language event that looks like


   dbcc dbrepair(<dbname>,readpage,<page number>) 

arrives, you should return an error to the client with srv_sendmessage indicating that the function is not supported, and then call srv_senddone with a status of SRV_DONE_FINAL and SRV_DONE_ERROR. For example:

   #define SRV_NOT_SUPPORTED   SRV_MAXERROR + 5 //as an example

   // Check to see if this is a command we cannot handle
   // First check for dbcc
   if (strstr(query, "dbcc") != (char *)NULL)
   {
     // now check to see if it is one of the problem commands
     if ((strstr(query, "readpage")  != (char *)NULL) ||
         (strstr(query, "writepage") != (char *)NULL) )
     {
       srv_sendmsg(srvproc, SRV_MSG_ERROR,
                   (DBINT) SRV_NOT_SUPPORTED,
                   (DBTINYINT) 16, (DBTINYINT) 1, NULL, 0, 0,
                   "Function not supported by this connection",
                    SRV_NULLTERM);
       srv_senddone(srvproc, SRV_DONE_FINAL | SRV_DONE_ERROR,
                   (DBUSMALLINT)0, (DBINT)0);
       return(SRV_CONTINUE);
     }
   } 


STATUS

Microsoft has confirmed this to be a problem in Open Data Services version 4.2 for Windows NT. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Additional query words: ODS access Windows NT


Keywords          : kbprg kbtool SSrvODS SSrvSQL_Admin kbbug4.20 SSrvWinNT 
Version           : 4.2
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 20, 1999