Runtime error after splitting database

artlaw

New member
Local time
Today, 20:05
Joined
Dec 21, 2020
Messages
13
Hi, I'm hoping someone out there might be able to help me with this issue - it is doing my head in!

I have developed a database that will be rolled out to multiple users who will only have the Runtime version of Access installed. I have transferred the database to a test computer with the Runtime installation and the database works perfectly. However, when I split the database and re-run it on the test computer it immediately throws a -3034 runtime error and crashes.

Does anyone have an idea of what might be causing this? Unfortunately I don't have an option but to split the database as it will be used by multiple users.

Thanks!
 
maybe Relink the tables.
be sure to use UNC, path (\\ComputerName\Path\yourBE.accdb).
create the Runtime version and test the runtime.
 
Thanks for the suggestion. I have re-linked the tables with appropriate path but still no luck. The database backend is currently sitting in the same folder as the front end, on the C drive of the local computer not the server (C:/Users/database_be.accdb). Would I need to use a UNC path in this case? It runs fine on the development computer like this, just not on the test computer with the runtime installation.
 
Does your code compile?
Do you have Option Explicit declared in all your modules?
 
you moved the Backend to a Shared folder.
make sure that you assign all Rights to "Everyone" user.

use appropriate runtime for your office. x32 if you have x32. x64 for x64 office.
 
Any Unhandled Error will cause a runtime to crash completely. Whereas previously you may have gotten away with not handling all errors perfectly, you won't be able to any more.

I'm not completely certain this is your case - but might want to check..
 
After looking at the web for error 3034, I see many different possible interpretations. What was the text of the error associated with 3034?
 
Error 3034 = You tried to commit or rollback a transaction without first beginning a transaction..

In other words you are trying to save or undo something before it has started
 
Thanks everyone for the suggestions. So far I have:

1. Added error handlers to all subs
2. Declared Option Explicit in each module
3. Confirmed that both the runtime and Microsoft Office installation are both 32-bit

The error message that I receive is "There is no message for this error"... not very helpful.

I had previously missed a few error handlers out of the more simple subs. Since adding them in I can get a bit further into the app and this is where it gets really interesting:

1. On the first load, the database throws a -3034 error immediately and crashes out. The error handler indicates that it makes it into the first sub, which is the Form Load event on a modal form (the first form displayed).
2. On the second load, the database makes it to the second sub, the OK button click event of the modal form. It then throws a -3034 error and crashes out.
3. On the third load, the database makes it through the first two subs on to a subsequent form. It then throws a -3034 error and crashes out.
4. On the fourth load, it doesn't throw any errors and seems to become more stable.

The forms are displaying data from the back end, so the path must be correct.

Please keep the suggestions coming!
 
@isladogs - Thanks for the suggestion but I am not using transactions. The first sub is just a simple QueryDefs execution.
 
Ok ... so what is the error description you get for error 3034 and which line of code triggers it?
 
The error description is "There is no message for this error". The first runtime error (a system error dialog, not one of my error handlers) occurs immediately on opening the database, before any code has been executed. After click OK on this error it continues through the first subs code until it hits the qdf.Execute line. This throws the 3034 error and it fails to pull data from the backend. If I then close, and reopen the database, it makes it through the qdf.Execute line absolutely fine and retrieves data from the backend. However it then throws 3034 errors on other sub routines, including a sub with no database queries - just a DoCmd.OpenForm command.
 
OK -take those one at a time...
I don't believe you get an error before any code has run but you can easily test that by moving it to a non-trusted location.
Does an error really appear before you click the security bar button to enable content?

Next open the database with the shift bypass so no code runs.
Add break points on each line of the initial startup code and run manually line by line
What causes the first error 3034?
 
Thanks again for the quick reply @isladogs. Just FYI I am only encountering errors when using the Runtime installation of Access. It works fine in the full version. I don't think that I am able to run shift bypass and add in break points in the runtime version, but please correct me if I am wrong. Instead I have added message box break points to give me an understanding of which line triggers the error. It is the qdf.execute line in the following code:


Code:
Private Sub Form_Open(Cancel As Integer)

    On Error GoTo ErrorHandler

    Dim db As DAO.Database
    Dim qdf As DAO.QueryDef
    Dim rs As DAO.Recordset
    Dim Username As String
 
    Set db = CurrentDb

    'log username and time
    Username = Environ("UserName")
    
    Set qdf = db.QueryDefs("qryWriteUserLog") 'this is referring to a query in Access
    qdf.Parameters("pUsername") = Username
    qdf.Execute

    qdf.Close
    db.Close

    Set qdf = Nothing
    Set db = Nothing

    Exit Sub

ErrorHandler:
    MsgBox "Form: modStart / Sub: Form_Open(). Error: " & Err.Number & " " & Err.Description
    Resume Next

End Sub
 
can you Comment out the following:

'qdf.Close
'db.Close
 
Sorry, forgot the errors were only in the runtime version.
You can easily test the runtime environment on your own workstation by changing the file suffix to .ACCDR
But before you do. First check that there are no references marked MISSING. Also check whether the code compiles as previously mentioned by another member.

Did you test placing the file in a non-trusted location if only to eliminate the first issue that you thought the error occurred before any code runs.

Can you please provide the SQL for your query qryWriteUserLog as you say that triggers the error when you try to execute it. What type of query is that?
 
1. On the first load, the database throws a -3034 error immediately and crashes out. The error handler indicates that it makes it into the first sub, which is the Form Load event on a modal form (the first form displayed).
2. On the second load, the database makes it to the second sub, the OK button click event of the modal form. It then throws a -3034 error and crashes out.
3. On the third load, the database makes it through the first two subs on to a subsequent form. It then throws a -3034 error and crashes out.
4. On the fourth load, it doesn't throw any errors and seems to become more stable.

This behavior bothers me the most. It ALMOST seems to indicate that you must have "side effects" in your code that initialize things as you go, and that because of error handling, the Runtime version doesn't catch the errors correctly. In this context, I use "side effects" to mean that something attempts to update a global variable after the code has started, and something about the error handling or external references is handled differently between Runtime vs. full Access.

I'm not going to swear this is your problem, but that description makes me think it is happening that way.

Do you have something that late-binds some definitions or something like that?

EDIT: Second question: Does this "stepwise" improvement occur as you make these tries in the same session? If so, do you get that stepwise improvement if you log out and log back in between failures?
 
Sorry, forgot the errors were only in the runtime version.
You can easily test the runtime environment on your own workstation by changing the file suffix to .ACCDR
But before you do. First check that there are no references marked MISSING. Also check whether the code compiles as previously mentioned by another member.

Did you test placing the file in a non-trusted location if only to eliminate the first issue that you thought the error occurred before any code runs.

Can you please provide the SQL for your query qryWriteUserLog as you say that triggers the error when you try to execute it. What type of query is that?
I have tested the database in runtime on my development computer and it works fine. I have also compiled the code - it threw up one undefined variable. I have fixed this but it doesn't resolve the issue.

The SQL query run on start up is very simple - please see below.


Code:
INSERT INTO tblUserLog ( Username, LoginTimestamp )
VALUES ([pUsername], NOW());
 

Users who are viewing this thread

Back
Top Bottom