Link to home
Start Free TrialLog in
Avatar of Andy Brown
Andy BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Converting Access 2016 from 32-bit to 64-bit

I am about to deploy my Access application onto a Windows 2012 R2 server for testing, so want to convert it to 64-bit.

After making backups and downloading the 64-bit version of Office 2016, I loaded the application and got a compatibility issue message, indicating that I needed to check some of the library declarations.  After a quick look on the web, I saw that you needed to add PtsSafe to the string so,

Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

becomes

Private Declare PtrSafe Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

This certainly gets rid of the compile errors and I'm just about to start testing.  However, how do I know if the library/declaration is genuinely 64-bit compliant.  For instance, I see references to "kernel32"?

Thanks as always.
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Download Win32API.txt from Microsoft it has a list of the 64 bit API declarations.
It will be installed in the following location: C:\Office 2010 Developer Resources\Documents\Office2010Win32API_PtrSafe
Avatar of Andy Brown

ASKER

Thanks MacroShadow - really appreciated.

However, how do I actually use the txt file?  I only have about 20 declarations in the code and so far, I haven't seen an issue.  However, I'd really like to be 100% sure.
ASKER CERTIFIED SOLUTION
Avatar of Joe Howard
Joe Howard
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it - thank you.
If you are going to have both 32-bit and 64-bit versions in production, you might want to use conditional compilation statements.  You can have Declare statements for both environments, but only the one for the appropriate environment will actually compile.
Just to be clear; just because your running under a 64 bit OS does not mean you need to run 64 bit Office.   In fact unless you have very specific reasons for doing so, Microsoft still recommends a 32 bit install of Office.

Jim.
I am about to deploy my Access application onto a Windows 2012 R2 server
Where the BE is located is irrelevant.  The only relevant criteria is the version of Office you are running.  PC's have been 64 bit for many years.  Office has offered 32-bit and 64-bit versions for many years.  You can only run the 64-bit version of office on PC's that are running the 64-bit version of Windows on 64-bit hardware.  But you can run the 32-bit version of Office on either 32-bit or 64-bit windows and hardware.

As Jim has already pointed out, even Microsoft recommends sticking with the 32-bit version of Office.  The only reason for moving to the 64-bit is because you need to use humongous spreadsheets.  Switching to 64-bit Office means that you will lose any 32-bit add-ins you are using and will have to replace them with 64-bit versions if 64-bit versions are available.  Also the bit-version of office is an all or nothing proposition.  Either all components are 32-bit or they're all 64-bit due to shared libraries.  And finally, if you find that you have users with both 32-bit and 64-bit versions of Office and you distribute .accde's, you will need to have two separate computers (or use a VM) because you can only create .accde's in the compatible  bit with the appropriate version of Access.
Great point Pat - thank you - It's leading on to a related question.