migrating to MS Access 64 bit (vba code)

dionisis71

New member
Local time
Today, 10:38
Joined
Sep 18, 2012
Messages
2
Hi,

I migrate my vba code to 64-bit. When i debug my code i get "Invalid use of new keyword".

Code:
Static StrConn As New Connection

It works fine with 32 bit, but this time it needs to be writen in a different way and i have no luck with google. I couldn't find any example for 64 bit.

thank you
 
I recently migrated to 64 Bit version... I however did not have a New Keyword in my code, so am not sure if this will help.. Try it and let me know if it does..

Step - 1 : Open a New module.
Step -2 : Paste the following Code.
Code:
#If Win64 Then
    'Declare PtrSafe Function FunctionName Lib "kernel32" () As LongLong
    Private Declare PtrSafe Function LoadLibrary Lib "kernel32" _
    Alias "LoadLibraryA" (ByVal lpLibFileName As String) As LongLong
    
    Private Declare PtrSafe Function FreeLibrary Lib "kernel32" _
    (ByVal hLibModule As Long) As LongLong
    
    Private Declare PtrSafe Function GetCurrentThreadId Lib "kernel32" () As LongLong
#Else
    'Declare PtrSafe Function FunctionName Lib "kernel32" () As Long
    Private Declare PtrSafe Function LoadLibrary Lib "kernel32" _
    Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
    
    Private Declare PtrSafe Function FreeLibrary Lib "kernel32" _
    (ByVal hLibModule As Long) As Long
    
    Private Declare PtrSafe Function GetCurrentThreadId Lib "kernel32" () As Long
#End If
Step - 3 : Save it and Compile the Code. See if you still get the error.
 
thank you for your post..


I am still getting the error...
 

Users who are viewing this thread

Back
Top Bottom