Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 Runtime Missing Functions 3

Status
Not open for further replies.

cpaige

Programmer
Jun 19, 2000
86
0
0
CA
Hello Everybody!
I was running into a problem where an Access VBA program was crashing in the Access 2000 Runtime Environment. My solution was to comment out all the code and uncomment each line one by one. What I found was that certain functions were not supported including the following: format, trim, left and right. When I use any of these functions the code doesn't even run. I assume it crashes when it's being interpreted. Has anyone ever heard of this? Is it possible I'm missing a DLL on the machine running the Access 2000 Runtime? Any info would be great. I'm getting very frustrated.

Thanks Clayton T. Paige
claytonpaige@yahoo.ca

Programmer Extraordinaire

========================================================

"Who is General Failure? and Why is he reading my disk drive?"
 
I've been experiencing the same issue when distributing apps to other PCs. I bet you're missing mscomct2.ocx or mscomctl.ocx. Make sure these are installed on each of the computers you are distributing your app to.

You can be certain which dll/ocx may be missing by opening the code window, select tools, select references. In the available list you'll see a big MISSING: 'something'. Click on it to view the name of the missing component at the bottom of the references screen.

Good Luck,
Poop
 
Clayton,

You might want to make sure you have included the MS DAO library in your run time environment since the functions you motioned as not working are defined under DAO rather than under the A2K default ADO library.
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
You should probably look into using the package and deployment add-in to distribute your database so any necessary activex controls will be installed with it.

Also, assuming you're not using macros to do your processing, you should add error handlers to every procedure that could cause a runtime error.

I include a 'References' form in my databases that can be called from the menu, that displays the state of references on the running instance of the program. If the program will open without crashing, I can open this form and check the references even in a runtime scenario.

All it requires is a form with a 3-column listbox. Set the listbox's Row Source Type to 'Value List', and set the listbox's Row Source during form load using:
Code:
  Me.Listbox1.RowSource = GetReferences()
The listbox should be about 6 inches wide with the Column Widths set at 0.5;1.0;

Use the following function to retrieve your references:
Code:
'@--------------------------------------------------------@

Public Function GetReferences() As String

On Error GoTo ErrHandler
  Dim strMessage As String
  Dim strStatus As String
  Dim refItem As Reference
  Dim strReferences As String
  Dim strPath As String
  Dim strName As String
    
  For Each refItem In References

    If IsError(refItem.Name) Then
      strStatus = "BAD"
      strName = ""
    Else
      strStatus = "OK"
      strName = refItem.Name
    End If
  
    If IsError(refItem.FullPath) Then
      strStatus = "BAD"
      strPath = ""
    Else
      strStatus = "OK"
      strPath = refItem.FullPath
    End If
    
    If refItem.IsBroken Then strStatus = "BAD"
    strReferences = strReferences & strStatus & _
        ";" & strName & ";" & strPath & ";"

  Next refItem

  GetReferences = strReferences

ExitHere:
  Exit Function
ErrHandler:
  MsgBox "Error: " & Err & "-" & Err.Description
  Resume ExitHere
End Function
VBSlammer
redinvader3walking.gif
 
Slammer,

Very nice function. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
I FOUND THE PROBLEM!!!

I really don't understand why this is the case, but it works. I looking through the references and found I had some Crystal Reports Active DLL's includes. Earlier in development I was trying to produce the reports for the DB with Crystal. This didn't work very well, but I forgot I had referenced them. The computer that had the runtime environment did not have these DLL's. I removed the reference and it solved the problem.

Thanks everybody for the help.
Clayton T. Paige
claytonpaige@yahoo.ca

Programmer Extraordinaire

========================================================

"Who is General Failure? and Why is he reading my disk drive?"
 
This is a VERY common problem with an easy fix. Open any module in design mode. Chances are you will immediately go into debug mode because of a compile error. Use Run/Reset and open the Tools/References to find out which reference is missing. Uncheck any unmissing references and compile the code. It's nice to be able to have a form to show the references, but unless you know how to correct a problem it doesn't do much good.

There are knowledgebase articles addressing this issue on When it is unable to locate a reference on your system Access stops looking for any other references listed below it on the priority scheme. 99% of the time this will result in Access not being able to find the VBA libraries where format, trim, left and right are all intrinsic functions.
-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Thanks for the GetReferences code, I implemented as you wrote, and it works very clearly and very well. I will be using it to resolve installation issues such as this in the future.

Thanks,

Neal Neal Miller
President
Miller Systems, Inc.
(708) 479-0085
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top