FIX: Garbled Field Name Is Returned with VFP OLEDB Provider on Windows 95

This article was previously published under Q314735
This article has been archived. It is offered "as is" and will no longer be updated.
On a computer that is running Windows 95, you use the Visual FoxPro (VFP) OLEDB Provider to create an ActiveX Data Objects (ADO) recordset based on a VFP table. When you reference one of the fields in the table, one of two problems may occur:
  • If you reference the field name by the fields collection index number (for instance, "RS.Fields(0).Name"), garbled output appears.
  • If you reference the field name directly by specifying the field name (for instance, "Fields("f1").Name"), the following errors may occur:

    Microsoft Visual Basic error message
    Item can not be found in the collection corresponding to the requested name or ordinal.
    Visual FoxPro error message
    Member FIELDS does not evaluate to an object.
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 theMicrosoft Knowledge Base:
316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack
Microsoft has confirmed that this is a problem in the VFP OLEDB Provider installed with Visual FoxPro 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.

Steps to Reproduce Behavior

  1. Use Visual FoxPro 7.0 to build the following code into a new executable (.EXE) file:
    #DEFINE adUseClient             3#DEFINE adOpenStatic            3#DEFINE adLockBatchOptimistic   4CD JUSTPATH(SYS(16))ERASE TestDBF.*CREATE TABLE TestDBF (F1 c(5))INSERT INTO TestDBF VALUES ("HELLO")USE IN SELECT("TestDBF")LOCAL loRS AS ADODB.RecordSet, ;	loConn AS ADODB.CONNECTIONloConn = CREATEOBJECT("ADODB.Connection")loRS = CREATEOBJECT("ADODB.RecordSet")loConn.CursorLocation = adUseClientloConn.OPEN("Provider=vfpoledb;Data Source=" + JUSTPATH(SYS(16)))loRS.OPEN("SELECT * FROM TestDBF", loConn, adOpenStatic, adLockBatchOptimistic)WITH loRS	MESSAGEBOX("Fieldname should be f1.  It is " + .FIELDS(0).NAME)	MESSAGEBOX("Fieldname should be f1.  It is " + .FIELDS("F1").NAME)ENDWITHloRS.CLOSEloConn.CLOSERELEASE ALL					
    NOTE: This sample code requires ADO, which does not ship with Windows 95 but is included with the Microsoft Data Access Components (MDAC) package. You can obtain the latest version of MDAC from the following Web site:
  2. Install the executable and the pre-SP1 release version of the Visual FoxPro OLEDB Provider on a Windows 95 computer.
  3. Run the EXE to see the error messages.

Article ID: 314735 - Last Review: 10/24/2013 09:03:36 - Revision: 2.3

  • Microsoft Visual FoxPro 7.0 Professional Edition
  • kbnosurvey kbarchive kbbug kbclientserver kbcodesnippet kbdatabase kbfix KB314735