question

TrinhNghi-2431 avatar image
0 Votes"
TrinhNghi-2431 asked DanielPineault-1898 answered

Ribbon for 64 bit system

I have an issue when change from 32 to 64

70679-error.jpg


And it alert on this code:

70610-code-error.jpg


office-access-dev
error.jpg (267.1 KiB)
code-error.jpg (249.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CData-3904 avatar image
0 Votes"
CData-3904 answered

An Access application built in 32 bit may not operate correctly in 64 bit Office/Access.

Typically your best solution, and recommended by Microsoft, is to return/reinstall Office as 32 bit [the operating system may still be 64 bit]

Only large data excel users need 63 bit Office..

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ghn-3178 avatar image
0 Votes"
ghn-3178 answered

You should do exactly what the err msg is instructing, go to the declarations and add the string PtrSafe in between 'Declare' and 'Function'.

Than usually works for me in my projects.102321-scrnsht-ptrsafe.jpg



scrnsht-ptrsafe.jpg (94.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Isladogs-4862 avatar image
0 Votes"
Isladogs-4862 answered

Adding PtrSafe is necessary but not sufficient for API declarations to work in 64-bit
In addition all instances of Long for handles/pointers such as hWnd need to be converted to LongPtr.
The 5 memory functions above are incorrect and should be:

 Declare PtrSafe Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As LongPtr) As LongPtr
 Declare PtrSafe Function GlobalFree Lib "kernel32" (ByVal hMem As LongPtr) As LongPtr
 Declare PtrSafe Function GlobalLock Lib "kernel32" (ByVal hMem As LongPtr) As LongPtr
 Declare PtrSafe Function GlobalUnlock Lib "kernel32" (ByVal hMem As LongPtr) As Long

 Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DanielPineault-1898 avatar image
0 Votes"
DanielPineault-1898 answered

You should quickly review

https://www.devhut.net/2017/04/13/access-x32-vs-x64-compatibility/

But basically your API declarations all need updating, any ActiveX controls need to be replaced, ...

It's a choice you have to make, either uninstall a office and reinstall the 32-bit version so your database works as is, or update the database to 64-bit rules.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.