This database was created with the 32-bit version of Microsoft Access. Please open it with the 32-bit version of Microsoft Access.

Falcon88

Registered User.
Local time
Tomorrow, 01:42
Joined
Nov 4, 2014
Messages
318
Hi all dears

I have a db with extension mde .

That was open normally by access 2007
, now i use access 2016 but gives
Msg
( This database was created with the 32-bit version of Microsoft Access. Please open it with the 32-bit version of Microsoft Access.)

I haven't machine with 2007
HOw to open on my machine?
 
Please confirm: Is your Access 2016 installation 32 bit or 64 bit?

If it's 64 bit, you will need to recreate the mde (or accde) using 64 bit Access to be able to use the resulting accde or mde with 64 bit Access.
 
Or

Remove 64 bit office, and install 32 bit office.

Part of this is caused because MS used to install 32bit by default, and now installs 64 bit.
As I just found out, it's very difficult to remove 64 bit in order to install 32 bit.

It just said "cant install 32bit". It didn't offer to uninstall 64bit. It turned out one-note needed removing.
I also found I had german, french, italian, dutch and spanish versions pre-installed as well.

And I only seemed to be able to find the 32-bit installer within my MS account.
 
Hi all dears

I have a db with extension mde .

That was open normally by access 2007
, now i use access 2016 but gives
Msg
( This database was created with the 32-bit version of Microsoft Access. Please open it with the 32-bit version of Microsoft Access.)

I haven't machine with 2007
HOw to open on my machine?
I had this error. The cause was there were function declarations in 32-bit format but not in 64-bit format, see structure below...

#If Win64 Then
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#Else
Public Declare Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#End If
#Else
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#Else
Public Declare Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#End If
#End If
 
remove the #Win64 declaration and simplify to:
Code:
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
#Else
Public Declare Function apiGetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
#End If
 
I had this error. The cause was there were function declarations in 32-bit format but not in 64-bit format, see structure below...

#If Win64 Then
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#Else
Public Declare Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#End If
#Else
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#Else
Public Declare Function apiGetWindowsDirectory& Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long)
#End If
#End If
The conditional compiler directives are there to ensure the code works correctly on different versions of Windows and Access.

The #If Win64 compiler directive is used to conditionally compile code that should only be included when the target platform is 64-bit Windows. Inasmuch as 32 bit Windows is pretty rare these days, it is almost always superfluous, as Arnelgp pointed out.

The #If VBA7 compiler directive allows you to conditionally compile code that is specific to the VBA 7 environment. VBA 7 was introduced, IIRC, with Access 2010. Any accdb that needs to run in Access 2007 or earlier would still need this conditional compiler directive. Whether it is still needed for compatibility, therefore, depends on what version of Access your users have installed.

You'll find a fuller discussion here: https://isladogs.co.uk/32-64-conditional-compilation/index.html
 
The #If Win64 compiler directive is used to conditionally compile code that should only be included when the target platform is 64-bit Windows.
That is incorrect and often misunderstood. The name “Win64” is misleading. It refers to the bitness of Microsoft Office, not Windows. ;)
 
whether win32 or win64, it doesn't matter.
you only need to test if you are using VBE7 (VBA7).
because declaring PtrSafe and LongPtr only works with VBA7 and is required by VBA7.
Longptr will be converted to Long if you are using 32 bit and to LongLong (if appropriate) for x64.
 
remove the #Win64 declaration and simplify to:
Code:
#If VBA7 Then
Public Declare PtrSafe Function apiGetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
#Else
Public Declare Function apiGetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
#End If

Better still, if all your users are on A2010 or later, remove the conditional compilation completely and just use:

Code:
Public Declare PtrSafe Function apiGetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
     (ByVal lpBuffer As String, ByVal nSize As Long) As Long

Coming back to #If Win64, the ONLY time I use it is to check the bitness of Office:

Code:
Function IsOfficex64()
'checks if Office is 32 or 64 bit

#If Win64 Then
  IsOfficex64 = "64-bit"
#Else
  IsOfficex64 = "32-bit"
#End If

'Debug.Print IsOfficex64

End Function
 
Last edited:
That is incorrect and often misunderstood. The name “Win64” is misleading. It refers to the bitness of Microsoft Office, not Windows. ;)
Good point. I should not have copied the reference without double-checking that.
 
@GPGeorge
Not sure which reference you copied.
However, just to be clear, that incorrect comment about the Win64 compiler directive didn't come from my article that you linked in post #6.

Thanks for adding the link however!
 
@GPGeorge
Not sure which reference you copied.
However, just to be clear, that incorrect comment about the Win64 compiler directive didn't come from my article that you linked in post #6.

Thanks for adding the link however!
No, it was the first one I found in Google, rather than relying on memory. I was wrong anyway. :(
 

Users who are viewing this thread

Back
Top Bottom