Solved

MSAccess - Date(), Str() function causing Runtime Error 13 in ACCDE

Posted on 2012-03-22
8
1,305 Views
Last Modified: 2012-03-28
In development, MS Access 2010, queries using the Date() function and Str() function work just fine.

When I compile to an ACCDE however and run under Access Runtime 2010, execution of these queries generates a runtime error 13, type mismatch.

All references are set correctly. If they were not, the functions would not work in development.

Thank you.
0
Comment
Question by:akivashapiro
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75
ID: 37753501
Do you mean like:

Dim x

x = Date()

and you get a type Mismatch ?

Also, in your dev  environment you can emulate the runtime scenario by starting your db using the Runtime switch off the Command Line ... fyi ...

mx
0
 

Author Comment

by:akivashapiro
ID: 37753622
Actually, not in vba, but in a query:


SELECT Date() AS [Test 2];

You may have to add a table in for the query to run.

I tried it with the runtime swtich, and it still worked in my development environment.
0
 

Author Comment

by:akivashapiro
ID: 37753655
In addition to Date() and Str() it seems also Ucase() does not work.

Please see attached.
Error-3075-Ucase.png
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 37753768
These are *classic* cases/examples of a Reference issue ... almost ... guaranteed ... can't think of much else at the moment.

mx
0
 
LVL 77

Expert Comment

by:peter57r
ID: 37753778
Are you saying that you have the runtime and the development versions installed on the same machine?

If not, then it just looks like a common references problem.  Any differences in library file locations or versions between the development machine and the runtime machine  can cause reference failures.
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 250 total points
ID: 37753971
I have to agree that you are probably having a reference issue.
All of the references MUST have the exact same path on the development machine and the production machine.

32-bit machines vs 64-bit machines (Program Files vs Program Files(x86))
Office 2003 vs Office 2007 vs Office 2010 (Office 10, Office 11, Office 14)
Different drives (c: d: ect)

If the run-time isn't installed to exactly the same path as the full-blown Office, you may have grief.  Look at the path to MsAccess.exe on both machines.  Is it an absolute match?
0
 

Author Closing Comment

by:akivashapiro
ID: 37777523
I found the solution. The development machine was running Office 2010 and the production machines are running Office 2007. Three type library's referenced in development did not exist on the production machines for Outlook, Excel, and Word 2010.  I copied those type libraries to the production machines on the same path and it worked. <br /><br />What is strange is that instead of an error at load time or an error that indicated an "unknown function" or some such, I got a type 13 type mismatch error. <br /><br />Thanks for your input.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 37779452
Busted references tend to make mundane function stop working--which is why all of us were pretty sure that you had a reference issue.  The error messages tend to be misleading.  What happens is that fairly mundane functions run, and they are known by the VBA code, but they have some dependencies on the busted references, and then things go BANG!

Glad you got it figured out!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 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