FIX: AV in MSADCE When Executing a SHAPE Query Using a .udl File

ID: Q208210


The information in this article applies to:
  • ActiveX Data Objects (ADO), versions 2.0, 2.1


SYMPTOMS

The following procedure results in an Access Violation in Msadce.dll (version 2.10.3513.2):

  1. Use the MSDataShape OLEDB Provider to create a .udl file.


  2. Use ADO 2.1 with client-side cursors to connect to a .udl file.


  3. Issue a SHAPE query.



CAUSE

ADO is not able to recognize that you are using the Shape Provider because the connection string contains a reference to a .udl file instead of a reference to the Shape Provider.


RESOLUTION

To work around this problem do either of the following:

  • Use a connect string instead of the .udl file to open the connection. For example:


  • 
    cnn.Open "Data Provider=MSDASQL;DSN=Pubs;uid=sa;pwd=;" 
  • Use server-side cursors.



STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This problem has been fixed in Microsoft Data Access Components 2.1 Service Pack 2. You may download this service pack from the following site:

http://www.microsoft.com/data/download.htm


MORE INFORMATION

Steps to Reproduce Behavior:

  1. Create a .udl file using Microsoft Data Links. To do so, right-click on the Windows desktop, point to New, and select Microsoft Data Link. Use the MSDataShape Provider and reference a DSN pointing to the Pubs database in SQL Server.


  2. Create a blank Visual Basic standard exe project, insert a command button into form1, and add the following code to the Click Event:


  3. 
          Dim cnn As New ADODB.Connection
          Dim rst As New ADODB.Recordset
          Dim rsChapter As Recordset 'Variant
          cnn.CursorLocation = adUseClient
          cnn.Open "File Name=c:\data sources\pubs.udl"
          rst.Open "SHAPE  {select * from authors}APPEND ({select * from titleauthor} AS chapter RELATE au_id TO au_id)", cnn 

Additional query words:

Keywords : kbADO210bug kbDatabase kbSQLServ kbGrpVBDB kbGrpMDAC kbDSupport kbADO210sp2fix
Version : WINDOWS:2.0,2.1
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.