Solved

How do I get a system I developed with 32-bit Access to run with people running 64-bit Access

Posted on 2014-09-23
7
179 Views
Last Modified: 2014-11-13
I've created a data reporting system using 32-bit Access with Basic background code  but it will run on a machine running 64-bit Access.
0
Comment
Question by:rwoosley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 85
ID: 40339696
A 32-bit Access app should run in 64-bit Access, so long as you're not using 32-bit controls/apis or such.

You can't compile 32-bit Access apps to .mde/.accde and run them on 64-bit Access, however. You'd have to create two distinct versions - one for 32-bit, and another for 64-bit.
0
 
LVL 58
ID: 40339715
If you have used any API calls, then you'll need two versions or use compiler directives.   Also as Scott mentioned, controls and references all need to be 64 bit if your using 64 bit.

BTW, here is some helpful info if you did use any API calls:

This will help you determine what might need to be changed:

Microsoft Office Code Compatibility Inspector user's guide
http://technet.microsoft.com/en-us/library/ee833946.aspx

also read:

 Compatibility Between the 32-bit and 64-bit Versions of Office 2010
http://msdn.microsoft.com/en-us/library/ee691831(office.14).aspx

and the section "Introducing the VBA 7 Code Base" for the general overview.

All the new 64 bit calls are here:
http://www.microsoft.com/download/en/confirmation.aspx?displaylang=en&id=9970

a list of all the calls that were modified for 64 bit:
http://msdn.microsoft.com/en-us/library/aa383663(VS.85).aspx

Jim.
0
 

Author Comment

by:rwoosley
ID: 40339737
Got it.  I'll take a look at the Inspector.  I also found your response to the same problem back in March of 2010.  I'll check out both and get back  Thanks!!
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 37

Assisted Solution

by:PatHartman
PatHartman earned 500 total points
ID: 40340028
If you have any influence regarding versions, get your client to stick with the 32-bit version of Office UNLESS they have an absolute need to support humongous spreadsheets.  There is absolutely no other reason to switch and several reasons to not switch including the loss of any 32-bit add ins your Office apps might be using as well as the code change to account for changing any API calls that use pointer variables.

As Scott said, if you have to support both environments and you must deliver a compiled app, then you must maintain two separate development environments since you can run compiled databases in the other bit-version.
The first part of the code below is copied from a web entry - the link is at the end.  It explains generally what you need to do.  The second part is the implementation of the API call that I used.  You will need to locate the specific instructions for the API call you are using in order to find out what arguments need changing.

''''''''Conditional compiling
''''''''
''''''''If your code needs to run on both 32 bit and 64 bit Excel, then another thing to do is add conditional compilation to your VBA.
''''''''
''''''''Microsoft devised two compile constants to handle this:
''''''''
''''''''VBA7: True if you're using Office 2010, False for older versions
''''''''
''''''''WIN64: True if your Office installation is 64 bit, false for 32 bit.
''''''''
''''''''Since the 64 bit declarations also work on 32 bit Office 2010, all you have to test for is VBA7:
''''''''
''''''''#If VBA7 Then
''''''''     Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
'''''''' #Else
''''''''     Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
'''''''' #End If
''''''''
''''''''
''''''''And then in the routine where this function is put to use:
''''''''
''''''''#If VBA7 Then
''''''''     Dim hDC As LongPtr
'''''''' #Else
''''''''     Dim hDC As Long
'''''''' #End If
''''''''Dim lDotsPerInch As Long
'''''''''Get the user's DPI setting
'''''''' lDotsPerInch = GetDeviceCaps(hDC, LOGPIXELSX)

'''''''''''''''''''''''''''''''''''''''''''''
'''
''' http://www.jkp-ads.com/articles/apideclarations.asp
'''
''''''''''''''''''''''''''''''''''''''''''''''''
#If VBA7 Then
     Public Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias _
             "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
        
     Public Type OPENFILENAME
         lStructSize As Long
         hwndOwner As LongPtr
         hInstance As LongPtr
         lpstrFilter As String
         lpstrCustomFilter As String
         nMaxCustFilter As Long
         nFilterIndex  As Long
         lpstrFile As String
         nMaxFile As Long
         lpstrFileTitle As String
         nMaxFileTitle  As Long
         lpstrInitialDir As String
         lpstrTitle As String
         flags As Long
         nFileOffset As Integer
         nFileExtension As Integer
         lpstrDefExt As String
         lCustData As Long
         lpfnHook As LongPtr
         lpTemplateName As String
     End Type
    
 #Else

     Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
             "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
        
     Public Type OPENFILENAME
         lStructSize As Long
         hwndOwner As Long
         hInstance As Long
         lpstrFilter As String
         lpstrCustomFilter As String
         nMaxCustFilter As Long
         nFilterIndex  As Long
         lpstrFile As String
         nMaxFile As Long
         lpstrFileTitle As String
         nMaxFileTitle  As Long
         lpstrInitialDir As String
         lpstrTitle As String
         flags As Long
         nFileOffset As Integer
         nFileExtension As Integer
         lpstrDefExt As String
         lCustData As Long
         lpfnHook As Long
         lpTemplateName As String
     End Type
 #End If

Open in new window

0
 

Author Comment

by:rwoosley
ID: 40340546
Got it, again.  Good to know.  It actually is not the client but a colleague on the ground that inadvertently (how I don't know) was issued a laptop configured to run 64 rather than 32-bit.  

The part about the 2 development environments rings especially true.  I will make the case to avoid this in the future using your strong arguments!  

Thanks again.
0
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40342072
The install CD (or download in the case of O365) includes both versions and the license is good for both.  So, your colleague can uninstall the 64-bit and install the 32-bit version of Office and still use the same license.
0
 

Author Closing Comment

by:rwoosley
ID: 40441522
Sorry it took so long to get back to this.  I ended up having to give the uncompiled 32-bit Access 2000 version database to another colleague of mine to modify and (I'm assuming) test in his 62-bit Access environment.  In any event, his modifications worked.  He essentially removed all the background Access DECLARE statements and reworked a module that referenced them.  I haven't had a chance to do a one-to-one comparison of the code but his mods worked.  I tried using the Compatibility Inspector to no avail unfortunately.  Thanks for the effort just the same.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question