Solved

Autoexec error on Access 2003 runtime program run on Windows 2000 sp3 computer

Posted on 2006-11-14
15
744 Views
Last Modified: 2012-06-27
I installed my Access 2003 program using the Runtime package wizard onto three computers. It works fine on the two Windows XP computers but not on the Windows 2000sp3 computer. I get the following error when the autoexec macro runs:

Action Failed
Macro Name: AutoExec
Condition: True
Action Name: RunCode
Arguments: autoexec()

The autoexec macro calls my autoexec function. The called procedure, LinkTables, relinks the tables in the backend database. Here's the function:

Function AutoExec()
On Error GoTo AutoExecErr

    'Take care of startup duties.
   
On Error GoTo AutoExecErr

    AutoExec = True
    Call LinkTables
    DoCmd.OpenForm ("frmStartup")
       
AutoExecDone:
    On Error Resume Next
    DoCmd.Hourglass False
    On Error GoTo 0
    Exit Function

AutoExecErr:
    Select Case Err
    Case Else
        MsgBox "Module AutoExec, Error#" & Err.Number & ": " & Err.Description, _
         vbOKOnly + vbCritical, "AutoExec"
    End Select
    Resume AutoExecDone

End Function


0
Comment
Question by:gordonwwaugh
  • 8
  • 5
15 Comments
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
Are you able to debug the code as it runs?
0
 

Author Comment

by:gordonwwaugh
Comment Utility
It's the runtime version of Access that is being used, so the VBA environment is not available.

All my procedures have error-trapping code. The macro error is the only error that appears.

If I had a Windows 2000 computer with Office 2003 on it, I would run the program using the full version of Access to try to debug it.
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
My suggestion to begin with is to make sure all mapping is the same. If that proves unfruitful, it looks like it never makes it to your error check. The error looks like it's the macro itself that's reporting the error.
0
 

Author Comment

by:gordonwwaugh
Comment Utility
What do you mean by "mapping?"

Although I cannot set breakpoints, etc., I suppose I could add a message box right after "Call LinkTables."

I am wondering whether I should do away with the autoexec and just move Call LinkTables to frmStartup (which is unbounded) and make frmStartup my startup form. What do you think?
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
mapping - I'm referring to mapped network drives. Depending on where your back end is located, it may simply not be able to get to it. But the same applies. If this is a .mde that you're running though, it is sometimes flaky when it comes to reporting proper errors. It seems like something besides the linking is wrong though, because again..the error is being reported by the macro, and not your error handler.
Have you tried to open the database while holding down the Shift key? This should bypass your Databases Setup and take you straight to the database window.
J
0
 

Author Comment

by:gordonwwaugh
Comment Utility
When the program is first used on another computer, the path for the linked database is, indeed, invalid for the new computer. The LinkTables procedure deals with that by checking to see if the link is valid. If it is not, then the user is asked to navigate to a valid backend database file. This all works fine using the full version of Access 2003--and using the runtime version on some computers.

The shift key does not bypass the macro when the runtime version is used. In addition, the runtime version does not support the database window.
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
I'm just guessing here but I'm sure it has to do with your Windows 2000 environment. The dll's are kept in a different directory location. Since you can't use the VBA window, you wouldn't be able to see if there are any missing references. There are miles of discussion about this topic here on EE. I work in a mixed environment as well, where we have all manner of OS and Windows versions. I am forced to compile my database apps in the lowest possible scenario. I do not know how this might apply to you though, as you're using a runtime wizard. I still do not believe it's even gettting to run your code, it's failing at the macro call to the code.
J
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

 

Author Comment

by:gordonwwaugh
Comment Utility
Thanks. I only program in VBA-Access, and I rarely create a runtime installation. So, I have not really had to deal with problems related to differing Windows environments. As long as the user had the current Windows and Office service packs, things have worked fine so far.

I suppose my best next step would be to install Office 2003 on the offending computer. Then I can use the full version of Access, use the debugging environment, check for missing references, etc. If the problem occurs with both the full and runtime versions of Access 2003, then I should be able to find it. If the problem, however, is limited to the runtime version, I might be out of luck.
0
 

Author Comment

by:gordonwwaugh
Comment Utility
I found the problem, but not the cure.

I found a computer with Win2000sp4 and Office 2003. I opened my Access program using the full version of Access 2003. It hit an error when it found a Missing reference: "Microsoft ADO Ext. 2.5 for DDL and Security." When I selected this reference, it worked.

My computer, the one that created the Access program, has version 2.8 of this reference. So, I assume that the program was looking for version 2.8 when it ran on the Win2000 computer but could not find it.

My computer does not have version 2.5--only version 2.8--of the reference. I think that's because I also installed the SQL Server desktop engine on my computer.

Do you think things will work if I put version 2.8 on my computer and set that as the reference? If so, how do I put version 2.5 on my computer without messing things up? Both versions have the same filename:
   C:\Program Files\Common Files\System\ado\msadox.dll.

If all else fails, I can replace the code that uses the reference with DAO code. I am seriously thinking of doing that anyway--because the offending piece of ADO code is not working properly (relinking a linked database which has a database password). I rewrote some DAO code in ADO.
0
 

Author Comment

by:gordonwwaugh
Comment Utility
Correction.

I meant to ask, in the fourth paragraph: "Do you think things will work if I put version 2.5 on my computer ..."
0
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
Hey Gordon,
You might try the other way around actually. If you're able to compile the program on the 2000 machine, then try running it on the higher version computers.
There's a very good chance it will work for all environments. Compiling in the lowest, has been the only proven method I've found to run different environments. You can play upward, but you can't play downward.
J
0
 

Author Comment

by:gordonwwaugh
Comment Utility
Thanks, but I don't have another developers version of Access I can put on the Win2000 machine. I think I might have found a workaround, though. I do have a Win2000 computer with the full version (of Access 2003). I copied the database to the Win2000 machine. I opened it using full Access. It quickly halts due to a reference error. Then I fix the broken references interactively. I save the changes and exit the database.

I do the regular install on a third Win2000 computer. I replace the program database with the one I fixed on the other Win2000 machine. I have not tried this but iI think it should work.

By the way, I think the problem occurs only when I try to install the runtime version on computers that already have some version of the two offending ADOX libraries. The DLL files already exist (albeit the wrong version), so the installation program does not replace them.

I also wrote some code I found on the MS website that tries to fix broken references, but it did not work:
  http://support.microsoft.com/kb/194374/en-us
0
 

Author Comment

by:gordonwwaugh
Comment Utility
I ended up rewriting my ADOX code in DAO. Thus, the offending program library (i.e., ADOX) is no longer needed. This now works on at least one Win2000 computer. I suspect it will work on the others as well.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

763 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

8 Experts available now in Live!

Get 1:1 Help Now