Convert 32-bit to 64-bit

rollingzep

Board Regular
Joined
Nov 18, 2013
Messages
224
Office Version
  1. 365
Platform
  1. Windows
Hi All,

We have 15-20 Access databases, both mdb's and accdb's. These are Office 365 but in 32-bit.
1696426672231.png


But the IT directive is to start installing MS office versions with 64-bit.
I tried one of the existing Access application on a new machine on the MS office versions with 64-bit and I see this error,

1696426958249.png


Since all our DBs have codes for 32-bit, what is the best way to convert the existing DBs to 64-bit?
There are almost 10 users.

TIA
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
The number of users is irrelevant, it is the number of DBs.
I beleieve you will need to get the 64bit version ready for when each PC goes 64 bit.

Or you can take into account the bitness and code accordingly.

Here are a few links.
Might want to tell IT to hold off on a full swap until you have the DB ready?

 
Upvote 0
The number of users is irrelevant, it is the number of DBs.
I beleieve you will need to get the 64bit version ready for when each PC goes 64 bit.

Or you can take into account the bitness and code accordingly.

Here are a few links.
Might want to tell IT to hold off on a full swap until you have the DB ready?

After a bit of digging, I see this

Anywhere, there are declare statements the below should be used,

#If VBA7 Then
Private Declare PtrSafe Function GetTickCount Lib "kernel32" () As Long
#Else
Private Declare Function GetTickCount Lib "kernel32" () As Long
#End If

Does this mean in every module in all the databases where ever the Declare statements are?

TIA
 
Upvote 0
Yes if you want it to run in both environments.
You also need to change Long to LongPtr where needed, so not as simple as that above.
The trick is knowing which to change to Longptr.

Also ensure any active x objects work in 64 bit as well.

I am on 2007, so no need to worry for me. :)
 
Upvote 0
Hi I have had some luck at simply adding the PrtSafe statement to all my declare statements (i.e. Declare PtrSafe Function).
In the 64 bit MSO 365 environment it will alway say an error but if you use the #If VBA7 THEN
#ELSE
#END IF
I find in access it is best to have one module with all the API's the DB will use including the constants etc (easier to convert).
the non-64 bit statements will be in red but the access DB still functions normally.
If your functions use 64 bit then you may need to use the IF/Then?else as well. Here is an example:
#If VBA7 Then
Public Declare PtrSafe Function api_ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As LongPtr, ByVal nCmdShow As LongPtr) As LongPtr
#Else
Public Declare Function api_ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
#End If
#If VBA7 Then
Public Function FN_SetAccessWindow(nCmdShow As LongPtr)
Dim loX As LongPtr
#Else
Public Function FN_SetAccessWindow(nCmdShow As Long)
Dim loX As Long
#End If

#If VBA7 Then
On Error Resume Next
loX = api_ShowWindow(hWndAccessApp, nCmdShow)
FN_SetAccessWindow = (loX <> 0)
End Function

You need to identify those API's that needs handles and ensure they are LongPtr. I found it to be trial and error on a lot of them.
In that way the DB can run on both 32 and 64 bit and once you fully transfer you can simply remove the reference to 32 bit.

Good luck.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top