Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Overcoming compile error constants, fixed-length strings not allowed in converting Access 2007 32-bit file to Access 2010 64-bit?

Posted on 2010-09-07
3
Medium Priority
?
1,214 Views
Last Modified: 2013-11-27
All I have two modules that I'm trying to convert from Access 2007 32-bit to now Access 2010 64-bit and both are giving me the same error?

What is the correct syntax I should use for?

theh error I get is compile error.

Constants, fixed-length strings, arrays, user-defined types and declare statements now allowed as public members of object modules.  And all the statements are highlighted.

I've got some interesting insight from http://gpgonaccess.blogspot.com/2010/03/work-in-progress-and-64-bit-vba.html on how to overcome most functions but even with the PtrSafe I still get the errors.
Declare PtrSafe Function StartupShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Declare PtrSafe Function apiCopyStartup Lib "kernel32" Alias "CopyFileA" _
(ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal bFailIfExists As Long) As Long

Open in new window

0
Comment
Question by:stephenlecomptejr
  • 2
3 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 33617327
It appears that your API calls are for the 32 bit APIs.  If you are running in 64 bit, you must use the 64 bit APIs.
0
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 33617337
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 33618112
Also, those API calls may have been carried over from long-ago versions of Access.  They may not be needed any more, because of additions to the Access and Office object models.  Copying files, for example, can be done with the Scripting Runtime Library FileSystemObject.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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…

877 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