MOD2000: Jet ANSI 92 Objects Cannot Be Checked into Visual SourceSafe (202018)



The information in this article applies to:

  • Microsoft Office 2000 Developer
  • Microsoft Access 2000

This article was previously published under Q202018
Advanced: Requires expert coding, interoperability, and multiuser skills.

This article applies only to a Microsoft Access database (.mdb).

SYMPTOMS

When you try to check a Jet database that has queries or stored procedures created through the native OLEDB provider for Microsoft Jet into Microsoft Visual SourceSafe, the objects are not visible in the SourceSafe dialog box and cannot be checked in.

CAUSE

ANSI 92 objects, which are new in Access 2000, are not recognized by Visual SourceSafe.

RESOLUTION

If you plan to check your Access database objects into Visual SourceSafe, avoid creating stored procedures or queries through OLEDB. Instead, use standard Access queries or pass-through queries.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

Steps to Reproduce Behavior

These steps first use Visual Basic for Applications to create a Jet stored procedure named qryCustomers that lists three fields from the Customers table in Northwind. Then, the steps will try to check the procedure into Visual SourceSafe.
  1. On a computer that has Visual SourceSafe installed, open the sample database Northwind.mdb.
  2. Create a new module, and then type or paste the following functions:NOTE: The sample code in this article uses Microsoft ActiveX Data Objects. For this code to run properly, you must reference the Microsoft ActiveX Data Objects 2.x Library (where 2.x is 2.1 or later.) To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft ActiveX Data Objects 2.x Library check box is selected.

    Option Compare Database
    Option Explicit
    
    Function CreateProc(sqlString)
        CurrentProject.Connection.Execute sqlString
    End Function
    
    Function RunStoredProc(StoredProcName As String)
        Dim cmd As ADODB.Command
        Dim rst As ADODB.Recordset
         
        Set cmd = New ADODB.Command
        Set cmd.ActiveConnection = CurrentProject.Connection
         
        cmd.CommandText = StoredProcName
        cmd.CommandType = adCmdTable
        cmd.Execute
          
        Set rst = New ADODB.Recordset
    
        rst.Open cmd
    
        Do Until rst.EOF
            Debug.Print rst(0), rst(1), rst(2)
            rst.MoveNext
        Loop
    End Function
    					
  3. To create the stored procedure, in the Immediate window, type the following line, and then press ENTER:
    CreateProc("Create Procedure qryCustomers as SELECT * FROM Customers")
    					
  4. Type the following line in the Immediate window, and then press ENTER to run the stored procedure:
    RunStoredProc("qryCustomers")
    					
  5. Close the Visual Basic Editor.
  6. On the Tools menu, point to SourceSafe, and then click Add Database to SourceSafe.
  7. When you are prompted to close the database, click Yes.
  8. Log into Visual SourceSafe, and then in the Add to SourceSafe Project dialog box, click OK.
  9. You are prompted to create a new project for Northwind. Click Yes.
  10. Note that the Add Objects to SourceSafe dialog box appears. Note that in the list named Objects to Be Added, you do not see qryCustomers, and you cannot add the stored procedure to the Visual SourceSafe project.

REFERENCES

For additional information on viewing ADO created objects in a Jet database, click the article number below to view the article in the Microsoft Knowledge Base:

246213 PRB: Views Created Using ADOX Are Not Visible in Access 2000

For more information about Visual SourceSafe, visit the following Microsoft Web site: For more information about pass-through queries, click Microsoft Access Help on the Help menu, type what is an sql query and when would you use one in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbbug kbpending KB202018