Solved

MSAccess 2000 Runtime

Posted on 2001-07-12
18
496 Views
Last Modified: 2008-02-01
Hello all!

I have an A2k db which im trying to convert to a runtime version for the client.

I have created the Deployment Package including the Runtime and installed on a test machine (Win Nt4 running Office97, the development machine is running Office97 & Office2k on Win Nt4).

When I try to run anyting from a form which calls a function(non system) the I get the following:
"Execution of this application has stopped due to a run-time error"

Click Ok and the app exits.

I have a custom menu bar from which all the forms and reports are accessed by the user.

The db runs normally under retail Access2k and it seems that anywhere VBA code is being called the Runtime versin crashes.

has anyone ever come across similar problems ??????????

0
Comment
Question by:Jonathan Kelly
  • 9
  • 5
  • 2
  • +1
18 Comments
 
LVL 4

Expert Comment

by:krzycz
Comment Utility
1) Runtime is not a full Access. Some features are not
available in Runtime.

You can test your app in runtime mode, before you make a package. Just run Access with /runtime option. I.e.:

"C:\Program files\Microsoft Office\Office\msaccess/exe" /runtime "C:\My documents\mydatabase.mdb"


2) If everything works fine, it means that there should be another reason of your problems.

I.e. your applications causes a runtime-error error, but you don't handle this error. (In runtime mode you cannot debug your code and find an error point!)
Some errors are not dangerous, while other may crash down your application. So, you should add an error handling to every your procedure and function.

Hint: Try to run an example database (Northwind.mdb) on the test machine. Does it work or not?


3) Finally, your problems may be caused by wrong/incomplete Runtime installation.
Try to create any simple, small application. Just one table, one form, etc. Then, try to run this application on the test machine.
This will help you to decide if the problem is with the machine (runtime) or with your application.


4) Check out the file access permissions. Maybe some files
have read-only attribute or maybe user hasn't got a permission to modify the file?


Here are some ideas. HTH

Need help? - Just @skme!

0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
Hey there krzycz ,


I have already tested the app using the runtime switch u mentioned and everything runs as it should.

I do have error handlers in my code the problem is that the code never ever gets executed so the error handler is nerver loaded.

Rights and permissions are not the problem either as i have full admin access to both the devlopment and test environments.

Good idea with NWind, ill try it and get back ASAP but it
takes approx 2hrs to create the package.
Is that normal ?







0
 
LVL 4

Expert Comment

by:krzycz
Comment Utility
Don't create a package!
Just copy NWind.mdb to the test machine.
Runtimne is already installed, so you don't have to create a whole package. Especially, don't include a Runtime in the package!

2 hrs? Oh, God! It's absoluetly too long!
It takes only several minutes on my old machine (Pentium 200).
Usually, it's about 15 mins to create a package and to burn it on CD-RW.
0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
ok so i DONT have to recreate the package each time i make a change to the app?
0
 
LVL 4

Expert Comment

by:krzycz
Comment Utility
Not exactly.

Hmmm, if you make some little changes, you don't have to recreate a package. Just copy a new version of MDB/MDe to the user(s) machine(s), replacing the old version.

Of course, we talking about splitted database - there is an application file and data file(s). So, in many cases you can just replace the application file with the new one.

But if you add some ActiveX controls to your app or references some external libraries, then you should recreate a package, because these new components may be not installed on user machine(s).
They should be installed with your new package.

However, since you've installed a Runtime on user machine(s), you don't have to include Runtime in your package anymore. They already have Runtime on their machines.

Well, it's a good idea to create a full package from time to time. I.e. every time you release a "milestone" build of your application.
But if you only patched some bugs, there is no need to recreate a full package. Just distribute a new version of main mdb/mde file.



0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
ok i  grabbed the nwind db and created a new package (just to be on the safe side) but when installing the runtime i get this :
The dynamic link library MSDART.dll could not be found in the specified path
c:\winnt\;.c:\winnt\system32\;.c:\winnt\system\;.E:\oracle\ora8 blah blah blah loads more install paths.

it looks like my test machine is the problem - ????

0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
if i ignore install completes but of course i never created an autoexec for startup so all i have is a blank screen!!

if i create an autoexec and just copy in the .mdb straight to the test machine, will it work ?
0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
ok so northwind seems to run ok as a runtime version
even if i got the previous error.

so i suppose this means my code is wrong ?


0
 
LVL 4

Expert Comment

by:krzycz
Comment Utility
Probably yes.
Sad, but true. ;-)

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
on further testing i have found that i procedure seems to run about half way through and then crashes. this procedure calls 2 other sub procedres perfectly before the app crashes out.


this is really drivin me nuts!!

does anybody have an idea as to what is happening ?
0
 
LVL 4

Accepted Solution

by:
krzycz earned 300 total points
Comment Utility
Well, what is the code of this procedure?

Another idea: what is the size of your database?
Maybe try to pack it (ZIP) and send to me. I'll try to find an error.

krzycz2@poczta.onet.pl

0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
i have convinced the client to run with a full retail copy.
0
 
LVL 2

Expert Comment

by:kmoloney
Comment Utility
I know this is a long time after the problem, but what, Datrias, was the reason that run-time woudn't work?  We are having a similar problem with one of our applications and we don't want, much less can afford, full versions of MSACCESS on user's computers.
0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
Sorry, I never solved this problem and havent had to use the Runtime since.
0
 
LVL 2

Expert Comment

by:dom_cath
Comment Utility
I also had this problem and have solved it, although this may not help you.  In my code I was using dir(strFileName) to check to see if a file exists.  When I checked the program on a test machine I got the same error as you.  I checked the contents of strFileName and found out it was d:\path whereas the test machine with Access Runtime on it does not have a D drive or D drive was the CDROM with no CD in it.

I now use the following code to check if the path exists first:  (thanks Chris Rae)

Function DirExists(ByVal strDirName As String) As Boolean
    ' Chris Rae's VBA Code Archive - http://chrisrae.com/vba
    ' Code from the Deployment Wizard, passed on by Will Rickards.
    On Error Resume Next

    DirExists = (GetAttr(strDirName) And vbDirectory) = vbDirectory

    Err.Clear
End Function
0
 
LVL 7

Author Comment

by:Jonathan Kelly
Comment Utility
thanks dom_cath -  your comment could prove very valuable!
0
 
LVL 2

Expert Comment

by:kmoloney
Comment Utility
This is how we debug problems in Microsoft Access Runtime now:

1.  We created a dummy integer variable "int_dummy" and set it equal to zero at the beginning of the procedure creating the error (any variable type and value would work).

2.  at various parts of the program, we change the value of the dummy value by incrementing it, and then writing it to an external text file, e.g.,

Open "c:\test.txt" For Append As #1
int_dummy = int_dummy+1
write #1, int_dummy
close #1

You can copy this block at various parts in the code.  When the program crashes, we check out the value in test.txt, and that tells us the last block that executed before the error (if the test.txt has the last value as 4, we know that the error is in between the fourth and fifth blocks of code above).

3.  We can hone in on the problem if necessary by moving the fourth block of code down a line, successively crashing the program until the last value is one less the previous value (in this case, three).

Then we know the problem occurred in the line immediately preceding the fourth block.

Also, if you are using the open command in the sub, you will want to use "FreeFile" function instead of #1.  Dim a variable called FileNumber, and then use the following block for your auditing points:

   FileNumber = FreeFile
   Open "c:test.txt" For append As #FileNumber
   int_dummy = int_dummy+1
   Write #FileNumber, int_dummy
   Close #FileNumber

You should start putting this block immediately after your variable declarations, and before any signficant code.  That way you can tell if the code itself is causing a crash (test.txt would be empty).  If its not, there's nothing wrong with this block and the problem must be something else.

It's tedious, old-fashioned, and time-consuming, but it works.

Kevin
0
 
LVL 2

Expert Comment

by:dom_cath
Comment Utility
Hi Again,

The other time I got this error was when I had split my tables and had the database running in a multi-user environment.  The tables were stored on a network share that I had accidently left as ready only.  The first runtime opened the database correctly albeit in ready only but any second runtime had a problem as it could not leave or alter the ldb file and came up with this error.

If the tables are on a network share make sure the network share has write access for the users who use the database.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

15 Experts available now in Live!

Get 1:1 Help Now