none
Scanning both 32-bit and 64-bit Access files from one program? RRS feed

  • Question

  • I'm working on a (C#) program that is meant to scan network shares, find Access files, and scan their contents. I need to be able to open and read files from different machines regardless of whether they were created with 32-bit Access or 64-bit Access. Is that possible? I've been reading up on OLEDB drivers, and as near as I can tell the OLEDB model assumes that you are connecting with only one bitness. Is there an approach using OLEDB that will let me read both kinds of files from one executable? Or maybe there's a better option than OLEDB? Would Interop work? I'll use that if I have to.
    Tuesday, April 24, 2018 4:38 PM

All replies

  • I'm working on a program that is meant to scan network shares, find Access files, and scan their contents. I need to be able to open and read files from different machines regardless of whether they were created with 32-bit Access or 64-bit Access. Is that possible? I've been reading up on OLEDB drivers, and as near as I can tell the OLEDB model assumes that you are connecting with only one bitness. Is there an approach using OLEDB that will let me read both kinds of files? Or maybe there's a better option than OLEDB? Would Interop work? I'll use that if I have to.

    Tuesday, April 24, 2018 12:32 AM
  • Hi,

    Correct me if I'm wrong but won't 64-bit programs be able to read 32-bit applications? If so, I am thinking you can create a 64-bit C# program using a 64-bit OLEDB or ODBC and theoretically should be able to read both 64- and 32-bit Access files.

    Just a thought...

    Tuesday, April 24, 2018 4:44 PM
  • Where do you see anything saying there are different formats on disk? I have never heard of anything like that. Certainly there are 32-bit and 64-bit during execution but I have never heard of a difference on disk. So what have you read? Perhaps you just misunderstand so if you can post a link then someone can help clarify confusion. If you have not read something and are assuming there is a difference on disk then there is not.


    Sam Hobbs
    SimpleSamples.Info

    Tuesday, April 24, 2018 6:35 PM
  • If your scanning program does not launch + automate a copy of Access, then the bit size don’t matter.

    An Access x32 can open + read a x32 or x64 bit version of Access (note how I said open – not launch).

    And keep in mind that Access x32 can freely open accDB files – even ones created with x64 The  ONLY exception is a compiled accDE. That requires you match the bit size to LAUNCH the file.

    Note how I said launch! Access x32 or x64 is free to link or read the tables and data from such files.

    Since your scanning program is not launching a copy of Access, then I don’t see a issue or problem here.

    So there is no limitation on the bit size to read such files. However, launching access will require the correct bit size ONLY for accDE files. If you are using the DAO library for example to open such files, then bit size will not matter.

    For example, many have asked how can you open a separate file from access, but by-pass the autoexec file. If you automate a copy of access, then sure you launching Access, but you can always still do this:

       Dim MyDB    As DAO.Database

      

       Set MyDB = DBEngine.OpenDatabase("path to database")

    The above will allow me to read the database, but since I am not “automating” a copy of Access, then the autoexec does not run, but MORE important is the x32/x64 issue also does not matter.

    So we have to make a distinguish between launching a copy of Access vs that of “opening” a data file.

    Opening a data file does not care about x32/x64.

    And if you ARE automatizing Access, then the ONLY case when this matters is for a compiled accDE file. The data is not x32/x64, it only the compiled code that is.

    If your scanner is only opening files - and not launching a automated copy of Access, then the x32/x64 issue is a non issue.

    Regards,

    Albert D. Kallal (Access MVP, 2003-2017)

    Edmonton, Alberta Canada

    Tuesday, April 24, 2018 7:16 PM
  • @Sam

    You are correct. However, Access x32 cannot open a accDE file compiled as x64. And x64 Access cannot launch a x32 compiled accDE.

    So the file formats are not different, but the compiled code versions are. If you are deploying accDE, then the bit size of Access used to create that file must match.

    However, you can read my other response. The issue of "semantics" here is important. While Access x32 can't launch a x64 accDE file it can link or read tables from such files. So some "wiggle" room exists in what we mean by open + launch.

    Access x32 can't launch a x64 accDE, but you can link to the tables, or you can use the dao.OpenDataBase method to have use of the data. If we separate the concept of launch vs open, then yes, any version of Access can link or "open" tables regardless of the bit size version.

    As a result of the above? Well, we have now 8 versions of Access.

    (8 versions!!!!)

    x32 full

    x32 full (CTR)

    x64 full

    x64 full (CTR)

    runtime x32

    runtime x64

    runtime x32 (CTR)

    runtime x64 (CTR)

    Regards,

    Albert D. Kallal (Access MVP, 2003-2017)

    Edmonton, Alberta Canada

    Tuesday, April 24, 2018 7:24 PM
  • You are correct. However, Access x32 cannot open a accDE file compiled as x64. And x64 Access cannot launch a x32 compiled accDE.

    The question says nothing about that. If that is relevant then it should have been stated explicitly.


    Sam Hobbs
    SimpleSamples.Info

    Tuesday, April 24, 2018 7:34 PM
  • Much agree.

    I don't know if the scanner is using a automated copy of Access (the post does not seem to suggest as such).

    As noted, open vs launch is a context here.

    At the end of the day, 100% agree - you can read such files regardless of bit size.

    However, launching or what we mean by "open" from Access is VERY much why the poster is reading and seeing information in regards to x32/x64.

    So there is no documentation in regards to bit size that says file formats are different, but there is going to be BUCKETS of articles telling Access folks you can't open those different bit size accDE files - so "ample" articles will support the users confusing.

    The real answer is such articles don't make this issue clear - the "general" advice that the poster is reading is  you can't open those x64 accDE files with Access x32. As I said,  the issue of "open" vs "launch" is never made clear in such articles.

    So there not a shortage of posts and articles suggesting that you have to use the correct bit size to open such files (but what they really mean is to launch or open from the Access UI).

    So EVEN if the poster is only attempting to open such files, he going to read + see tons and tons of articles that suggest you can't do this.

    Regards,

    Albert D. Kallal (Access MVP, 2003-2017)

    Edmonton, Alberta Canada

    Tuesday, April 24, 2018 7:45 PM
  • I don't know if the scanner is using a automated copy of Access (the post does not seem to suggest as such).

    As noted, open vs launch is a context here.

    I have seen discussions get enormous when a question is vague and the person asking for help does not provide clarification.

    So now we will wait and hopefully get clarification of the requirements.



    Sam Hobbs
    SimpleSamples.Info

    Tuesday, April 24, 2018 8:03 PM
  • Bitness is irrelevant with respect to the database file itself. You just need to make sure you have the correct bitness of the OLEDB Provider installed for your C# app. For example, if your C# app is running 32-bit then you need to have the 32-bit ACE OLEDB Provider installed. For 64-bit, then the 64-bit components need to installed.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Wednesday, April 25, 2018 11:54 AM