Asked by:
Visual Foxpro (VFP) Database communication with ASP.Net / C# / MVC using COM

Question
-
User1852066214 posted
I am using a COM DLL (type library) created using vfp6 in my MVC 4 application for data manipulation with FoxPro DB. I can able to register the dll successfully using Regsvr32 and also can able to do references in my project.
In my web application i can able to create an object for the class of COM dll but not able to access its properties or methods. I got iisexpress.exe has exited with code -1073741819 (0xc0000005) access violation error when run the project from visual studio(admin mode) with debug.
If i run the project without debug i got System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) exception.
My Code piece is as follows:
Dim objCOM = new foxprocom() // this creats the instance without any issue
objCOM.Path = "my path" -- this line throws the errors. If i try with COM DLL created using VFP 9 it works well.
Is vfp6 COM dll compatible with .net 4.5? Or How can i handle VFP 6 DLL in .Net application?Thursday, August 4, 2016 3:18 PM
All replies
-
User-821857111 posted
Have you tried connecting using OleDb: https://www.connectionstrings.com/visual-foxpro/?
Friday, August 5, 2016 7:07 AM -
User1852066214 posted
I am not getting connection issue. While accessing the VFP 6 COM DLL, i am getting mentioned error.
Friday, August 5, 2016 9:26 AM -
User-821857111 posted
Have you enabled 32-bit applications for the relevant application pool in IIS? See here for how to do that with IIS Express: http://stackoverflow.com/questions/16226582/how-can-i-force-iis-express-to-run-in-32-bit-mode
Friday, August 5, 2016 9:46 AM -
User1852066214 posted
Yes, i have already enabled 32-bit applications in IIS. Still not working. If i try with Visual Foxpro 9 DLL it works fine. But Visual Foxpro 6 DLL is not working. Am i missing something?
Friday, August 5, 2016 9:51 AM -
User-821857111 posted
You are probably better off posting to a VFP forum. Your issue has nothing to do with the ASP.NET framework.
Friday, August 5, 2016 11:03 AM -
User1852066214 posted
Fine... Thanks Mikes for your support
Friday, August 5, 2016 11:29 AM