How can I intentionally let Access crash? - ms-access

I would like to find a way to let Access crash in such a way that when you re-open the database, you will get this popup message:
'The last time you opened "....accdb", it caused a serious error. Do you still want to open it?'
Reason for this that have to maintain a server with a lot of cronjobs that launch even more Access applications, and sometimes it happens that a crashed Access application cannot be launched anymore due to this popup which prevents opening the database until you click 'Yes'.
To test my solution (remove registry key HKCU\Software\Microsoft\Office\XX.0\Access\Resiliency\DisabledItems), I need to have an access database that crashes on request.
Is there a way to do this with a vba script?

Write a script that kills the running process.

Related

SSIS Connection manager - Account userid getting locked

we are using SSIS 2016 and with parameterize connections. Every time we open the solution the connection manager is trying to connect with the credentials available in the project.param , due to unavailability of the password and repeated trying the db user account is getting locked.
Looking for some inputs if there is any settings we could change for connection manager not to try to connect when the solution is opened.
Thanks for your time on this.
RR
If you change the project setting to work in Offline mode, you should be able to open the project without validation checks firing which should alleviate the ever-so-fun lockout policy. That might be a user solution file setting so each team member might need to set it.
A different approach is to leave the design time user value to a non existent account. The run-time will swap in the properly parameterized connection but any developer opening the packages won't lock anyone out.

Is it possible to run ms access in debug mode

I have some issue while application is starting, it does not give any errors and window completely with no control. Here is screenshot.
So my question is, can I somehow turn on debug mode and see what's happened?
There is no hidden debug mode, or anything like that, in Microsoft Access. There are things you can do, however:
Use the shift bypass key
Using the bypass key will stop any code from automatically starting, allowing you to alter the database before it crashes
Using Control + Break
Using Control + Break stops the currently running code, and takes you to the VBA editor. However, if the application is not responding, it might not respond to Control + Break either.
Remove trust from the database
Using the security centre, you can untrust a database, blocking most code. This will allow you to access and copy database objects without code interfering.
Debug causes of database crashes (e.g. decompile)
View this answer for a guide to debug causes of database crashes. Usually, decompiling does wonders.
Hold down Shift button(s) while you open the file.

Generate Scripts Wizard hangs without scripting all objects

I am trying to generate the database scripts(tables,triggers,views,procedures) in sql server 2008, all of sudden the scriptting wizards hang up at the end state saying that scripting is completed but the close button never enable, if i stop this some of the tablels are missing, please advise
Install earlier SSMS version.
For me bug was at 15.0.18358.0, changed to 15.0.18338.0 and the wizard started working.
If the wizard says "0 Remaining", this means it has determined all the objects that it needs to script, and is writing them out to your destination. If you are writing to a file, go to that file location in Windows Explorer, and keep refreshing the view. If the file keeps growing in size, this means everything is fine and the data is still being written. Be patient, and eventually the process will finish and the Close button will become enabled.

Getting random error: "The expression On Change you entered..."

Running Access 2010 on Citrix against a SQL Server 2008R2 backend. Occasionally my users will get an error reading:
The expression On Change you entered as the event property setting produced the following error: Overflow.
* 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.
Once a user gets this error during a session, he will continue to get it until he logs out of the database front end. He can then immediately relaunch the Access front end and go do whatever it was he was attempting to do. The On Change portion will vary in event type (sometimes On Click, sometimes After Update, etc), and it will happen on different forms, but the fix is always to exit the DB then get back in and everything just works fine.
The more I learn, the more I'm starting to believe that it's got something to do with the Citrix enviornment that we're in, but I haven't been able to pin anything down.
I've seen the suggestions to copy the form, and to start with a new DB and import everything. I've done these and it hasn't really helped - i.e. this is random enough that I don't know if the frequency of issues decreased significantly after the change.
Does anyone have any additional suggestions of what I can do in my Access code?
Does anyone have any experience with this setup and have some Citrix or SQL Server tweaks that I might be able to pass along? (I don't know if our IT people will listen or try to work with me on it, but it's worth a shot.)
I'm frustrated with the randomness of this, and I hate telling my users there's nothing I can do about it, but at the moment, I'm completely stumped.
Thanks,
FreeMan
Edit - Additional details...
the users are running a compiled .accde
they are all running from a common .accde file
this is still happening for a few users to whom I have given their own personal copy to run
The goto fix for random weird stuff happening in Citrix is to disable hooking. Hooks get injected into every process running in a Citrix session, so they could be screwing up something in Access. You can configure registry entries to exclude Access from being hooked:
http://support.citrix.com/article/CTX107825

MS Access - Connection fails on load, causes app to not respond

I have an issue. I have an Access Project (currently in access 2007), and the project connection properties are set to point to a hosted SQL database on our network. Unfortunately we had to move the databasem and now I have to change the connection properties as well.
However, when I open the adp file, the first thing it does is try to connect to the old database. I never get prompted or anything, the screen just sits there, and the title bar eventually indicates "not responding".
Anyone know how I can get to the connection properties, since Access never gives me a chance to do so?
Have you tried keeping the shift key held down while the database is opening to prevent any start-up forms or macros from running? If that does not help, you can change all the connections from VBScript.