?
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
Medium Priority
?
181 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 38

Assisted Solution

by:PatHartman
PatHartman earned 1500 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 38

Accepted Solution

by:
PatHartman earned 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

752 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