UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Strangevba Error Cannot Open Database, Access 2016    
 
   
MS123
post Oct 10 2017, 10:29 AM
Post#1



Posts: 51
Joined: 28-November 16



Hi I have an Access 2016 db ODBC linked to a SQL 2012 backend. Randomly (it seems) as I'm using it I will click on something (eg a form button) and it will popup the following error:


The expression On Click you entered as the event property setting produced the following error: Cannot open database ''. It may not be a database that your application recognizes, or the fil may be corrupt.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro.


There's no pattern that I can see for which form or button I clicked prior to the error coming up.

Thanks
Go to the top of the page
 
MS123
post Oct 10 2017, 09:12 PM
Post#2



Posts: 51
Joined: 28-November 16



Would anybody have any ideas? This database is used in a user environment and everybody is randomly getting it and it's affecting everyone's work. Each user has their own local copy of the db so it's not a sharing thing as far as I can see. The only slight pattern noticed is that when someone has been using the db, leaves to go do something for a while, comes back and anything at all they click on any form gives this error. Giving them a fresh copy of the db puts things back to normal for a while.
Don't understand why it says - Cannot open database '' - as only have a single database, there's no code to open any other db.

Thanks
Go to the top of the page
 
gemmathehusky
post Oct 16 2017, 11:12 AM
Post#3


UtterAccess VIP
Posts: 4,432
Joined: 5-June 07
From: UK


Missing reference?

Are all users on A2016?
Do all users have their own copy of the front end?

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
MS123
post Oct 20 2017, 10:54 AM
Post#4



Posts: 51
Joined: 28-November 16



Hi yeah, all users on A2016 and all have their own copy of the front end.
Would the error message saying - Cannot open database '' - indicate something other than a missing reference? It seems to be trying to open some kind of database.
Go to the top of the page
 
MS123
post Oct 22 2017, 09:43 PM
Post#5



Posts: 51
Joined: 28-November 16



Would anyone have any more thoughts on this, it's hampering our work big time.
Many thanks
Go to the top of the page
 
gemmathehusky
post Oct 23 2017, 05:22 AM
Post#6


UtterAccess VIP
Posts: 4,432
Joined: 5-June 07
From: UK


The message itself would indicate a corrupt database, but missing references often manifest themselves in curious ways, and produce misleading errors of the sort you are seeing.
if they leave the PC and then it fails after a time, maybe it's a network connection issue. If the network connection drops while a user is away, then maybe that might manifest itself in strange ways.

Are you in a accdb or a accde?
If an accdb, then check the references, and try to compile the app.

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
MS123
post Oct 23 2017, 05:36 AM
Post#7



Posts: 51
Joined: 28-November 16



It's happening randomly and happening to random users, sometimes it's when a command button is clicked (any command button, any form, random), sometimes it's when the db has been idle, sometimes when viewing a report, sometimes when switching screens, I can't see any pattern.

The environment is a single server with multiple users connecting via remote desktop into their own remote desktops within the server.
They each receive their own copy of the ACCDE database when they log in.
Prior to putting any design changes live I compact/repair/compile the ACCDB, save as the ACCDE, then copy the ACCDE to central location where each user's login script copies it locally for them.

I had some success by recreating the ACCDB from scratch and importing all objects into it. Then putting it live as the ACCDE as usual. This lasted for 2 weeks without any errors then the errors started popping up more or less daily again.
If this is references-related - how would I know which references to add to test?
Go to the top of the page
 
gemmathehusky
post Oct 24 2017, 06:16 AM
Post#8


UtterAccess VIP
Posts: 4,432
Joined: 5-June 07
From: UK


do you call any MS office products within your database.
If so, have you included those dll's in your references, in which case try removing the references, and changing the use of such apps to late binding.

One problem is that you can't repair broken references in an accde. You can check them, but not repair them.


Do your users have multiple versions of access. If they opened the dbs with A2016, and then tried to open it with A2003 (say) - maybe after using a different database - , they might get the message you describe, as opening with A2016 might well set the project references to 2016 versions - which then do not make sense to A2003.

--------------------
Dave (Male)

(Gemma was my dog)
Go to the top of the page
 
MS123
post Oct 24 2017, 06:52 AM
Post#9



Posts: 51
Joined: 28-November 16



Hi, the only other Office products it calls is excel, via transferspreadsheet VBA coding, and Outlook new message via EmailDatabaseObject macro. However I have seen users get the corruption within minutes of opening the db having not exported or emailed anything.

I have the following references ticked:
  • Visual Basic For Applications
  • Microsoft Access 16.0 Object Library
  • OLE Automation
  • Microsoft Office 15.0 Access database engine Object Library


Here's some more information:
  • It's a single server with each user having their own remote desktop, linked to a back end SQL server for the tables.
  • I program the master database (ACCDB) via my remote desktop login, I have never once in the last 10 months of development encountered the corruption errors that the users are getting, and I've been working in it every day.
  • Each time I do an update in the ACCDB I compact/repair, save as ACCDE, put in a C: drive location on the server then a login script copies this ACCDE to the user's remote desktop so they each get their own local copy.
  • There's only Office 2016 installed on the server, so everybody accessing gets the same version (2016) of Access.


When the corruption occurs for the users (randomly, I still see no pattern to it), one or more of the following things happen:
  • Access crashes and creates a "backup" version (sometimes, sometimes not)
  • Error messages include:
  • The expression may not result in the name of a macro, user-defined function or Event Procedure
  • The last time you opened [database] it caused a serious error, do you still want to open it
  • Access has detected this database is in an inconsistent state and will attempt to recover the database
  • The database cannot be opened because the VBA project contained in it cannot be read, the db can be opened only if the VBA project is first deleted.
  • The expression OnClick you entered as the event property setting produced the following error: unrecognized database format
  • The expression OnClick you entered as the event property setting produced the following error: Cannot open database '' (this is the most common one people get, often followed by one or more of the others, there's no pattern to which button is clicked when this error comes up, could be any button on any screen, and there's nothing coded anywhere in the database that tries to open another database, it's all one single db)


I have tried decompiling/recompiling the master ACCDB and importing everything into a new Access db. Still keeps happening.
Go to the top of the page
 
BuzyG
post Oct 24 2017, 08:10 AM
Post#10



Posts: 340
Joined: 20-September 12
From: Cornwall UK


It might be worth opening the Excel and Outlook libraries. If the problem persists the you can soon switch them out again.

Microsoft Excel 16.0 Object Library

Microsoft Outlook 16.0 Object Library

--------------------
Live to Surf
Go to the top of the page
 
MS123
post Oct 24 2017, 08:18 AM
Post#11



Posts: 51
Joined: 28-November 16



Thanks BuzyG, yeah I have actually tested that, made no difference, corruption persisted.
Go to the top of the page
 
River59
post Oct 24 2017, 08:28 AM
Post#12



Posts: 1,347
Joined: 7-April 10
From: Detroit, MI


QUOTE
•Visual Basic For Applications
•Microsoft Access 16.0 Object Library
•OLE Automation
•Microsoft Office 15.0 Access database engine Object Library


Why are you using Access 16.0 Object Library and Office 15.0 Access database engine Object Library? Maybe switch them both to 16.0?

--------------------
Remember ... Armstrong, Aldrin and Collins flew to the moon and back with a computer system less complex than a modern, programmable toaster ...
Go to the top of the page
 
MS123
post Oct 24 2017, 08:56 AM
Post#13



Posts: 51
Joined: 28-November 16



There's no 16.0 "access database engine Object library" available, there's a "Microsoft Office 16.0 Object library" but that's different it seems and I've not needed that. I've had these same 4 references in the master ACCDB for the last 10 months without a single glitch, it's only the ACCDE's that are corrupting, so am not sure this is reference related at all.
Go to the top of the page
 
MS123
post Oct 24 2017, 09:21 AM
Post#14



Posts: 51
Joined: 28-November 16



Actually that has made me wonder why I only have "Microsoft Office 15.0 Access database engine Object library" available to choose, there's no 16.0 version to choose. Why would that be? I only have Office 2016 installed on this server.
What does this reference do exactly - could it possibly cause ACCDE's to corrupt?
Go to the top of the page
 
River59
post Oct 24 2017, 09:34 AM
Post#15



Posts: 1,347
Joined: 7-April 10
From: Detroit, MI


Here is another post that addresses references. You may glean some ideas from it.

http://www.UtterAccess.com/forum/index.php?showtopic=2025739

--------------------
Remember ... Armstrong, Aldrin and Collins flew to the moon and back with a computer system less complex than a modern, programmable toaster ...
Go to the top of the page
 
MS123
post Oct 24 2017, 09:39 AM
Post#16



Posts: 51
Joined: 28-November 16



Thanks, but I couldn't get from that why I don't have the 16.0 version to choose ? And for that matter why it isn't defaulted to that in the first place ?
Go to the top of the page
 
River59
post Oct 24 2017, 10:33 AM
Post#17



Posts: 1,347
Joined: 7-April 10
From: Detroit, MI


It points out that you may not need it. It was suggested the OP remove it and see what happens. If you don't have it, maybe you need to do a repair?

--------------------
Remember ... Armstrong, Aldrin and Collins flew to the moon and back with a computer system less complex than a modern, programmable toaster ...
Go to the top of the page
 
MS123
post Oct 26 2017, 08:03 AM
Post#18



Posts: 51
Joined: 28-November 16



ok further things I have tried:

Removing the references completely
Repair of Office (this brought back version 16.0 of the access database engine reference at least)
Distributing the ACCDB instead of the ACCDE

Issue still persists.
Wits end!! This is causing major problems with the users.

What it seems like when the corruption occurs is that the underlying VBA and Macros disappear somehow. It's as if they are no longer there so when people are clicking things it's throwing up errors about missing macro, missing code etc
Go to the top of the page
 
MS123
post Nov 1 2017, 11:32 PM
Post#19



Posts: 51
Joined: 28-November 16



Managed to trace it to group policy File Copy (User Config - Preferences - Files). This is used to copy the accdb from central location to user's documents folder at remote desktop logon. The file seems to copy fine when they log on (replaces the one that's there). They are definitely then using the local copy of the file (checked this) and then at some point the corruption occurs while they're using it. I removed the File Copy, copied the central db to their local folder manually, and the corruption doesn't occur. Anybody know why this would be? Is there an alternative to GPO file copy I could try.

Thanks
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 10:14 PM