BUG: Error 3622 Open SQL Server Table with Identity Column

ID: Q190620


The information in this article applies to:


SYMPTOMS

When you try to open a Dynaset in Visual Data Manager (or Visual Basic sample project VisData) against a SQL Server 6.5 table that contains an Identity column, you get the following error occur:

Error 3622 - You must use the dbSeeChanges option with OpenRecordset when accessing a SQL Server table that has an IDENTITY column.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

You can modify the VisData sample to avoid the error. There are two places that you need to make the changes. The first is for opening a recordset from the Database Window; the second is for when executing a SQL statement.

  1. In VISDATA.BAS, under the OpenTable() function, change:
    
       Set rsTmp=gdbCurrentDB.OpenRecordset(rName, dbOpenDynaset)
     
    -to-
    
       Set rsTmp=gdbCurrentDB.OpenRecordset(rName,dbOpenDynaset, dbSeeChanges)
     


  2. In VISDATA.BAS, under the OpenQuery() function, change:
    
       Set rsTmp = qdfTmp.OpenRecordset(dbOpenDynaset)
     
    -to-
    
       Set rsTmp = qdfTmp.OpenRecordset(dbOpenDynaset, dbSeeChanges)
     


For testing purposes, table IColTest is created in Pubs database with one Identity column and one VarChar column. To create a table and index in SQL Server, select Pubs database, then place the following Create Table T-SQL in the SQL window of ISQL/W and execute it:

   Create Table IColTest
           (Id_Col int Identity, Name VarChar(30) Null)
   Create Unique Index IIndex on IColTest(Id_Col) 

WARNING: ANY USE BY YOU OF THE CODE MODIFICATIONS PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code modification "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Microsoft does not support modifications to sample applications or tools.

Additional query words: kbDSupport kbdse kbvbp600bug kbAddIn kbDatabase kbdse


Keywords          : 
Version           : 
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: June 22, 1999