[AccessD] 64 bit app

McGillivray, Don DMcGillivray at ctc.ca.gov
Fri Oct 9 15:19:29 CDT 2015


The code snip wrapped strangely.  Trying again:

#If Win64 Then
    Private Declare PtrSafe Function CreateProcessA Lib "kernel32" ( _
        ByVal lpApplicationName As LongLong, _
        ByVal lpCommandLine As String, _
        ByVal lpProcessAttributes As LongLong, _
        ByVal lpThreadAttributes As LongLong, _
        ByVal bInheritHandles As LongLong, _
        ByVal dwCreationFlags As LongLong, _
        ByVal lpEnvironment As LongLong, _
        ByVal lpCurrentDirectory As LongLong, _
        lpStartupInfo As typStartupInfo, _
        lpProcessInformation As typProcInfo) As LongLong 
#Else
    Private Declare Function CreateProcessA Lib "kernel32" ( _
        ByVal lpApplicationName As Long, _
        ByVal lpCommandLine As String, _
        ByVal lpProcessAttributes As Long, _
        ByVal lpThreadAttributes As Long, _
        ByVal bInheritHandles As Long, _
        ByVal dwCreationFlags As Long, _
        ByVal lpEnvironment As Long, _
        ByVal lpCurrentDirectory As Long, _
        lpStartupInfo As typStartupInfo, _
        lpProcessInformation As typProcInfo) As Long
 #End If

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of McGillivray, Don
Sent: Friday, October 09, 2015 1:15 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] 64 bit app

Hi Rocky,

I have no doubt that others on the list are more knowledgeable than I am, but I just encountered the same need for the first time this week.  Here's what I learned/did:

1.	Because Access 32-bit cannot live on the same machine as Access 64-bit, you need a separate workstation (or virtual machine) running the 64-bit version of Access.

2.	Essentially, you can use the same code base (mdb/accdb) but it has to be compiled (converted to mde/accde) using the 64-bit version.  (Does A2003 have a 64-bit version?)

3.	If your code includes API calls, you will need to make the "Declare" parts conditionally compilable according to the "bitness" of the environment.  Here's a snip from my app as an example:

This tests for "bitness" and compiles accordingly.
#If Win64 Then
    Private Declare PtrSafe Function CreateProcessA Lib "kernel32" ( _
        ByVal lpApplicationName As LongLong, _
        ByVal lpCommandLine As String, _
        ByVal lpProcessAttributes As LongLong, _
        ByVal lpThreadAttributes As LongLong, _
        ByVal bInheritHandles As LongLong, _
        ByVal dwCreationFlags As LongLong, _
        ByVal lpEnvironment As LongLong, _
        ByVal lpCurrentDirectory As LongLong, _
        lpStartupInfo As typStartupInfo, _
        lpProcessInformation As typProcInfo) As LongLong #Else
    Private Declare Function CreateProcessA Lib "kernel32" ( _
        ByVal lpApplicationName As Long, _
        ByVal lpCommandLine As String, _
        ByVal lpProcessAttributes As Long, _
        ByVal lpThreadAttributes As Long, _
        ByVal bInheritHandles As Long, _
        ByVal dwCreationFlags As Long, _
        ByVal lpEnvironment As Long, _
        ByVal lpCurrentDirectory As Long, _
        lpStartupInfo As typStartupInfo, _
        lpProcessInformation As typProcInfo) As Long #End If

You may also have to make some of the other variable declarations in your API code conditional, too.  I confess that the API code in my app is totally cribbed, and my understanding of it and the implications of dual compiling are quite limited.  There may be other cases where conditional compiling is necessary, but I didn't run into any other problems on that score, so can't speak to that.  Google and experts here will be your friends for this.

4.	In my situation compiling on the 64-bit system breaks some references that I have to go back and repair before continuing to develop in the 32-bit environment.  This may be a bit of a wild card, depending on what you have specified as external references.  In my situation, the app is installed in-house only, so the range of possible configurations is limited, and my 64-bit machine is set up exactly like all of our 64-bit users' machines.  Others on the list may have better and more specific advice for dealing with this.

This is rather brief, but I hope it gets the ball rolling for you.  With luck somebody else will chime in with more and better ideas.

Don

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Friday, October 09, 2015 12:03 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] 64 bit app

Dear List:
 
I develop in A2003 still - 32 bit.  A user needs the app (mde) to run in the
64 bit version of Office.  What's the quickest/easiest way to give him what he wants?
 
MTIA
 
Rocky Smolin
Beach Access Software
858-259-4334
www.bchacc.com <http://www.bchacc.com/> www.e-z-mrp.com <http://www.e-z-mrp.com/>
Skype: rocky.smolin
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list