Solved

32 vs 64 bit versions of Access, how to convert

Posted on 2014-12-08
16
190 Views
Last Modified: 2015-01-08
I have clients using Office 2013, 2010, and 2007. Everyone on MS Office 2013 is 64 bit, some users on 2007 are 32. Clients received a MS Access 2007 database they need to open which is 32 bit. When they try to open in MS Office 2013 (64) it immediately fails warning the 32 bit is not compatible.

Anyone know a way to convert a 32 bit MS Access 2007 to 64 MS Office 2013?
0
Comment
Question by:WORKS2011
  • 4
  • 3
  • 3
  • +3
16 Comments
 
LVL 26

Expert Comment

by:MacroShadow
ID: 40487010
The only two issues (as far as I know) are ocx controls and api calls.

If your application uses 32 bit ocx's you will have to replace them with the 64 bit version (if they exist, if not you're out of luck).

As far as the api calls are concerned, you can use what's called conditional compiling which will enable using the same code on both 32 and 64 bit machines. Here is a sample:
#If Win64 then
' 64 bit api calls

#Else
' 32 bit api calls

#End If

Open in new window

0
 
LVL 17

Author Comment

by:WORKS2011
ID: 40487035
thanks macro shadow, I can't install the product sorry I mentioned they can't open, I meant to say I can't install.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40487069
MacroShadow has the gist of it right
There are new keywords and datatypes that must be used in 64 bit API calls
http://msdn.microsoft.com/en-us/library/office/gg278832(v=office.15).aspx
http://msdn.microsoft.com/en-us/library/office/ee691831(v=office.14).aspx

There is the PtrSafe keyword that needs to be employed, and LongPtr and LongLong data types.
You can walk through the VBA code base and alter the code as suggested in the articles.

You cannot use 32-bit ActiveX controls.
This may be the biggest PITA
Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar).These controls were installed by previous versions of Microsoft Office and are installed by 32-bit Office 2010. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010. 64-bit Office 2010 does not provide 64-bit versions of the Common Controls.
0
 
LVL 57
ID: 40487078
Your best option is to not use 64 bit if possible.  Microsoft is still recommending the 32 bit edition for most users as there are limited 3rd party controls for 64 bit, and few advantages.

If your distributing the app as a MDE/ACCDE, then you'll need to maintain two version no matter what.  As far as what needs to be changed, as MacroShadow said, any OCX controls, references to 32 bit libs, and API calls.

Here's some info to help with that:

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

Last, in the 64 bit edition of Office, all calls need to be 64 bit, which means any ODBC drivers you use must be 64 bit as well.

Again, it's best to stay away from the 64 bit edition if you can avoid it.

Jim.
0
 
LVL 26

Expert Comment

by:MacroShadow
ID: 40487086
I can't install the product
I don't understand which product can't you install?
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40487106
The other issue is with distributing an .accde.  Since the .accde is compiled, it MUST be produced by the correct bit-wise version of Access.  So, if you created the .accde using 64-bit Access then ONLY 64-bit versions of Access can run it no matter what you do with conditional compilation.  I think vice-versa it true also.  Conditional compilation only works if you distribute an .accdb.
0
 
LVL 12

Expert Comment

by:pdebaets
ID: 40487886
I distribute .accdb files that are both 32 and 64-bit compatible. The way I do it is to use a compiler directive constant that works for 99% of all the API calls out there. Here's an example:

#If VBA7 Then
    '* 64-bit declarations, which will work in Access 2010 and later, 32 and 64-bit versions
    Private Declare PtrSafe Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA" (ByVal hDC As LongPtr, lpMetrics As TEXTMETRIC) As Long
    Dim mhDC As LongPtr
#Else
    '* 32-bit declarations for 32-bit versions of Access before Access 2010
    Private Declare Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA" (ByVal hDC As Long, lpMetrics As TEXTMETRIC) As Long
    Dim mhDC As Long
#End If

Open in new window


... and here's how that function would be used:

lngret = GetTextMetrics(mhDC, tmTEXTMETRIC)

Open in new window

0
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

 
LVL 26

Expert Comment

by:Nick67
ID: 40487976
I never had a lot of joy from conditional compiling as an end-user no intervention required solution.
A2007+ have the PITA of FilterOnLoad with a default of true.

I figured I go

#If Application.Version > 11
    Me.FilterOnLoad=False
#End If


That looks nice.
But if I compiled it on A2003 and pushed it out, that PITA afflicted every up-level user, and if I compiled it on A2007, then everything was broken for the A2003 users because the references got shot.

Conditional compiling is nice, it lets you compile two different versions from the same source code.
But YOU as the developer have to create and push out multiple properly compiled versions to the clients.
Sigh.
As a far as I know, you can't get VBA to compile the project dynamically.
I could be wrong, though...
0
 
LVL 57
ID: 40488039
Checking VBA7 alone is not enough.    That only tells you if your running in vba7.   It's win64 that tells you if your running 64 bit.

Jim
0
 
LVL 57
ID: 40488048
Fyi there is a sys cmd call to force vba to compile.   I'll dig it out.  But if it were me, I'd never compile on the fly.  Too many things can go wrong.

Jim
0
 
LVL 12

Expert Comment

by:pdebaets
ID: 40488122
Jim, the 64-bit declarations are valid in VBA7, regardless of whether you are running in 32 or 64 bit.

There are SOME api calls that will require a check for Win64, but as I said my approach works for about 99% of api calls that I've come across.
0
 
LVL 57
ID: 40488628
@peter,

So  like I said, you need both.   For a handful of calls, in 64 bit the actual call changed.

 But if you are only going to use one, then win64 would be a better choice.  In the code example you gave, you'd be executing your 64 bit call for both 32 and 64 bit.   With Win64, which is only true in a 64 bit environment, your 32 bit call would always be called in a 32 bit environment, and 64 bit call in 64 bit environments. That would cover 100% of the cases then.

With that said, I'm not aware of any down side to using prtsafe and longptr in a 32 bit environment other than using more memory and giving up some performance.

Jim.
0
 
LVL 17

Accepted Solution

by:
WORKS2011 earned 0 total points
ID: 40529863
unable to find a resolution. Returned the product. Thank you for all the help.
0
 
LVL 17

Author Closing Comment

by:WORKS2011
ID: 40537501
unable to find a resolution
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40538181
I think we've all misunderstood what you needed.
I meant to say I can't install.
@WORKS2011
We still don't know what that meant.
You purchased a product that was based on a 32 bit MS Access 2007 database, and therefore you couldn't install it?
And so you returned that product because it was incompatible with your existing systems?
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

708 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