Microsoft KB Archive/314888

= FIX: OLE DB Provider Improperly Enumerates DBSCHEMA_TABLES =

Article ID: 314888

Article Last Modified on 3/4/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q314888



SYMPTOMS
When you use the Microsoft ActiveX Data Objects (ADO) Connection OpenSchema method, version 9262 of the Microsoft Visual FoxPro OLE DB provider may not identify tables properly.

The OLE DB provider identifies tables properly until the provider encounters a file with a file extension that has been modified, such as an executable (.exe) file that is renamed to have a .dbf file extension. The OLE DB provider may identify this file properly, but the provider will not identify tables properly after this point.



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in version 9262 of the Visual FoxPro OLE DB Provider, which shipped with Microsoft Visual FoxPro 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce Behavior
Run the following code from Visual FoxPro 7.0. The code will create four tables and one text (.txt) file that is renamed to have a .dbf file extension. CLEAR
 * 1) DEFINE adSchemaTables 20

LOCAL lcStr1 as String, ; lcMyDSN as String, ; loRS as ADODB.RecordSet, ; loConn as ADODB.Connection lcStr1 = &quot;This is a text file, not a .dbf&quot; lcMyDsn = &quot;Provider= vfpoledb;Data Source=&quot; + JUSTPATH(SYS(16)) loRS = NULL loConn = NULL

CD JUSTPATH(SYS(16))

CREATE TABLE Q314888_A.DBF (F1 i) CREATE TABLE Q314888_B.DBF (F1 i) STRTOFILE(lcStr1, &quot;Q314888_C.DBF&quot;) CREATE TABLE Q314888_D.DBF (F1 i) CREATE TABLE Q314888_E.DBF (F1 i)

INSERT INTO Q314888_A VALUES (1) INSERT INTO Q314888_B VALUES (2) INSERT INTO Q314888_D VALUES (3) INSERT INTO Q314888_E VALUES (4) CLOSE TABLES ALL

loConn = CREATEOBJECT(&quot;ADODB.Connection&quot;) loConn.OPEN(lcMyDSN) loRS = loConn.OpenSchema(adSchemaTables)

WITH loRS ? .FIELDS(2).NAME .MoveFirst DO WHILE ! .EOF ? .FIELDS(2).VALUE .MoveNext ENDDO ENDWITH

loRS.CLOSE loConn.CLOSE loRS = NULL loConn = NULL ERASE Q314888*.DBF

Additional query words: OLEDB kbVFP700sp1fix

Keywords: kbbug kbfix kbcodesnippet KB314888

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.