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
167 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
7 Comments
 
LVL 84
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 57
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 34

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 34

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now