FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Reading DBF/CDX via OLEDB
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Reading DBF/CDX via OLEDB
Posted: Mon Jan 05, 2026 09:34 PM

What is the best way to read DBF/CDX using OLEDB drivers. I was using the VFPOledb driver but it does not seem to work on the newer OS's. Does anybody know a trick to get it to work, or a better solution other than re-writing the entire app.

Thanks,

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Reading DBF/CDX via OLEDB
Posted: Mon Jan 05, 2026 09:50 PM

Dear Byron,

Gemini on the rescue :)

The "VFPOLEDB driver not working on newer OS" issue is almost always due to a specific architecture mismatch rather than the OS itself.

Here is the "trick" to get it working, followed by the best alternative solution if you need to move forward.

The "Trick": Force 32-Bit Execution

The Visual FoxPro OLEDB driver (VFPOLEDB.dll) is strictly 32-bit. It effectively does not exist for 64-bit applications.
Newer operating systems (Windows 10/11, Server 2016+) default to running applications in 64-bit mode. If your application tries to load the driver in a 64-bit process, you will get a "Provider not registered" error, even if you installed it correctly.

How to fix it:
You do not need to rewrite your app, but you must force the process running your code to be 32-bit.

  • If you are running a .NET Application (C# / VB.NET):
    Go to your Project Properties Build Platform Target. Change it from Any CPU to x86. Recompile and run.
  • If you are running a Website (IIS):
    Go to IIS Manager Application Pools Right-click your App Pool Advanced Settings Set Enable 32-Bit Applications to True.
  • If you are using a Script (PowerShell/VBScript):
    Do not launch the script from the standard command prompt. Instead, launch it from the 32-bit command prompt located at:
    C:\Windows\SysWOW64\cmd.exe

The "Better Solution": Advantage Database Server (ADS)

If you need a robust, modern solution that supports 64-bit processes natively and still reads DBF/CDX files perfectly (including Rushmore optimization), the industry standard alternative is the Sybase (SAP) Advantage Database Server.

  • Why it's better: It has a native 64-bit OLEDB provider. You can leave your application in 64-bit mode (Any CPU).
  • Compatibility: It reads .dbf and .cdx files directly.
  • Cost: There is a "Local Server" version (ALS) that is often free or low-cost for standalone/embedded use, but you should check current SAP licensing.

How to use it:

  1. Download and install the Advantage OLE DB Provider.
  2. Change your connection string.

Old String (VFP):

Code (csharp): Select all Collapse
Provider=VFPOLEDB.1;Data Source=C:\MyData\;

New String (ADS):

Code (csharp): Select all Collapse
Provider=Advantage OLE DB Provider; Data Source=C:\MyData\; ServerType=ADS_LOCAL_SERVER; TableType=ADS_VFP;

Troubleshooting Checklist

If you stick with the VFP driver, ensure you have these bases covered:

  1. The Correct Installer:
    Ensure you are using the VFP 9.0 SP2 driver. The best place to get this currently is the VFPX GitHub repository (look for VFPOLEDBSetup.msi), as official Microsoft links often rot.
  2. Permissions:
    The driver requires Read/Write/Modify permissions on the folder containing the DBFs. Newer Windows security is stricter about program files and root drives. Move your data to a folder like C:\Data\ and ensure the user "Everyone" (or your specific App User) has full control.
  3. NULL Support:
    Sometimes the driver fails on newer systems if SET NULL isn't handled. In your connection string, you can try appending:
    ...Data Source=C:\Data;Collating Sequence=MACHINE;NULL=NO;

Summary Recommendation

  • Quickest Fix: Force your application to run in x86 (32-bit) mode.
  • Best Long-term Fix: Switch to the Advantage OLE DB Provider to gain 64-bit support.

Would you like the specific C# or VBScript code snippet for testing if the driver is correctly registered?

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion