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

Article translations Article translations
Article ID: 314735 - View products that this article applies to.
This article was previously published under Q314735
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SYMPTOMS

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.

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 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.

MORE INFORMATION

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   4
    
    CD 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.CONNECTION
    
    loConn = CREATEOBJECT("ADODB.Connection")
    loRS = CREATEOBJECT("ADODB.RecordSet")
    
    loConn.CursorLocation = adUseClient
    loConn.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)
    ENDWITH
    
    loRS.CLOSE
    loConn.CLOSE
    
    RELEASE 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:
    http://msdn2.microsoft.com/en-us/data/aa937695.aspx
  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.

Properties

Article ID: 314735 - Last Review: October 24, 2013 - Revision: 2.3
APPLIES TO
  • Microsoft Visual FoxPro 7.0 Professional Edition, when used with:
    • Microsoft Windows 95
Keywords: 
kbnosurvey kbarchive kbbug kbclientserver kbcodesnippet kbdatabase kbfix KB314735

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com