Reputation: 313
Ive created a console exe that reads a .dbf database and outputs the results to a xml file, All works fine on my development machine (64 bit, win 10, Visual studio 2015), the created exe works fine on any 64 bit machine but crashes on 32 bit ones.
I have set the build to target x86
Ive tried a number of different connections strings, the ones that works on x64 machines are
con.ConnectionString = @"Provider=VFPOLEDB;Data Source=" + path + ";";
This throws up an Invalid Exception error "The VFPOLEDB" provider is not registered on the local machine" when run on a 32bit machine
The second connection string that works on x64 is
_connection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties=dBASE IV;";
This throws up:"The VFPOLEDB.1" provider is not registered on the local machine" when run on a 32bit machine.
I set up VS2013 on a 32bit windows 7 machine run the same code and it work then both in the dev mode and just by running the exe created separately.
any advice/suggestions would be most welcome.
Upvotes: 1
Views: 850
Reputation: 175826
You need to install the FoxPro OLEDB provider (VFPOLEDB) on your target machines:
https://www.microsoft.com/en-us/download/details.aspx?id=14839
(Probably best to use this package rather than just copying VfpOleDB.dll)
Upvotes: 1