Need to move to 64-bit version.

pr2-eugin

Super Moderator
Local time
Today, 08:17
Joined
Nov 30, 2011
Messages
8,494
Hi there,
I have been coding in MS Access 2010 (32-bit) for the past 10 months, and now my company taken over by others have their own server.. Who apparently have MS Access 2010 (64 bit) so my code does not work as expected, well lets just say it does not work at all.. As I need to use Declare and PtrSafe.. I tried looking online I found some information on MSDN website.. But it really has not given me a clue.. It says
Microsoft provides a Win32API.txt file which contains 1,500 Declare statements and a tool to cut and paste the Declare statement that that you want into your code.
But I have not a slightest clue which functions would I need.. I honestly do not even understand what it means.. Has anyone done this migrating the code to 64-bit? If so could you please please give me some information how to go around this?
 
This info came from another group I am part of
Code:
On a 64 bit OS, the 32 bit or 64 bit version of Office can be installed.
Your safest bet is to make sure it's 32 bit.  If that's the case, then
you'll have no real problems.

If however it's the 64 bit version (which even Microsoft is still not
recommending unless you absolutely need it), then you'll have a little bit
of work.

Any API calls you have will need to be checked.  If you want the DB to run
under both 32 bit and 64 versions or Access 2010, you'll need to use
compiler directives.

 Finally, if you use any ODBC data sources, make sure you can get 64 bit
drivers for them.  Office 64 bit can only use 64 bit drivers.  This is a big
sticking point for many because the rest of the world outside of Microsoft
still hasn't caught up with 64 bit.

There is NO DIFFERENCE IN PERFORMANCE between Office 2010 64 bit vs. 32 bit.

-----
Windows-7 (64 Bit) ODBC Driver Issue
>
> You need to make sure you use the correct ODBC Admin program (one in
> %systemdrive%\Windows\SysWoW64 folder).  Also make it a system DSN.
See
> the
> following MSKB article:
>
> http://support.microsoft.com/kb/942976
>
> Finially, if your trying to use 32 bit Access with other Office apps
and
> they are 64 bit, that won't fly.  Everything has to be one or the
other.

I hope some of that is useful to you.
I have 2003 and XP, so am not familiar with 2010 nor 64 bit.
 
Hello jdraw.. Thanks for the reply.. I had hard time understanding..
Any API calls you have will need to be checked. If you want the DB to run
under both 32 bit and 64 versions or Access 2010, you'll need to use
compiler directives.
Then finally after some trial and error found that all I needed to do was this..
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
I have no idea, where this struck me, just put this in a seperate module now it works in both 32 and 64 bit..
 
Glad you have it sorted out.
 
Hello jdraw.. Thanks for the reply.. I had hard time understanding..
Then finally after some trial and error found that all I needed to do was this..
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
I have no idea, where this struck me, just put this in a seperate module now it works in both 32 and 64 bit..

Hi. Please I want your help . I have this file attached in Excel . This converts directions(column B) to coordinates(columns J and K) through Button GEOCODE. My problem is that I have a client in another country who have Excel 2010 of 64 Bits and the VBA doesn't work(The PtrSafe attribute Message)
So I read your post and add a "module 1" with the same code you wrote. This still works in my computer 32 bits but I would like you tested this first in Excel of 64 bits before I send to my client.
The original file is GoogleMapping.xlsm and you can download in Google

I really appreciate your help. Thanks a lot
 

Attachments

Users who are viewing this thread

Back
Top Bottom