none
OleDBConnection use for 32 bit and 64 bit application in same machine RRS feed

  • Question

  • Hi,

    I create a dll that are used for 32 bit and 64 bit application in same machine .In this dll we need to create OleDbConnection and ODBC Connection for read SQL, Excel and Text file  data  into a  Dataset. So can we create oledbconnection or get the data for both 32 bit and 64 bit application in same machine? How we can achieve the resultant data by using OleDbConnection for 32 bit and 64 bit application in same machine and same time.

    Sunday, June 2, 2019 7:17 AM

All replies

  • You can install Microsoft Access Database Engine 2016 Redistributable (or older versions)

    with flag /quiet  (or /passive for older versions)

    I tested on Windows 10 to read .xls or .xlsx with Jet.OLEDB or ACE.OLEDB

    Installed drivers versions can be checked with

    odbcad32.exe (64-bit)

    or

    c:\Windows\SysWOW64\odbcad32.exe (32-bit)

    Sunday, June 2, 2019 12:04 PM
  • Hi ,

    Thanks for reply..

    I had used that scenario but I was not able to run 32 bit and 64 bit application at same time and same Machine. Basically there are two application( 32 bit  and 64 bit application) and my dll is common for that application..it was working on only one architecture but I need it work on both architecture at same machine...

    Sunday, June 2, 2019 5:14 PM
  • Are you able to run two copies of the 64-bit application at the same time?  I'm wondering if this is not a fundamental problem, rather than a 32/64 problem.  There is nothing about the bittedness that should affect simultaneous access.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, June 3, 2019 4:10 AM
  • No I create a two application one is 32 bit application and 2nd is 64 bit application. That are two different modules and my dll is build with 'any cpu' and  this dll contains a code that will connect with oledbConnection. when I install 32 bit access engine then it will not work with 64 bit application and when I installed 64 bit access engine then it will not work with  32 bit application.because my both application will run on same machine so at a time only one architecture will work...

    Window 10 OS is 64 bit 

    Monday, June 3, 2019 5:02 AM
  • Hi Ravi,

    Thank you for posting here.

    Based on my test, I could not reproduce your problem even if I create two applications, one is 32 bit application and the other is 64 bit application. They could call the method that in a classlibrary successfully.

    Before that I have installed Microsoft Access Database Engine 2010 Redistributable from here. I suggest that you could install it to see if the problem still exists.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 3, 2019 5:32 AM
    Moderator
  • You need BOTH Access engines installed.  If someone runs a 32-bit app, your AnyCPU code will be compiled into 32-bit, and it will call the 32-bit Access engine.  If someone runs a 64-bit app, your AnyCPU code will be compiled into 64-bit, and it will call the 64-bit Access engine.  If you need to support both, then you have to install both engines.  It's just that easy.  The system knows which one to call.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, June 3, 2019 6:37 PM
  • Hi

    Is your problem solved? If so, please post "Mark as answer" to the appropriate answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 18, 2019 7:18 AM
    Moderator