Hello All,
I posted an “Access Security” question that I have now found to be a ADODB question. I hope no one minds me re-posting the question under a different Subject….
Running Access 2000, when I go from design mode to view mode on my forms I get the following error:
Run-time error ‘-2147467259 (80004005)’ The database has been placed in a state by user ‘Admin’ on machine ‘WEIGET1’ that prevents it from being opened or locked.
What I think is happening is when I open a form in design mode, it locks the database so I can make design changes. Then, when I flip back to view mode I have some VB that is opening a connection to the database using an ADODB connection. Here is the code for the connection:
Set Conn = New ADODB.Connection
Conn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:My DocumentsdatabasesCurrentCopy(Tonya)ProductReleaseControl.mdb;”
But, when the VB connection executes the database is still locked from when I was in design mode so the connection fails and gives me the runtime error. So, what can I do to be sure that there is no existing connection that locks the database and causes the VB connection to fail? Is there anyway to release a lock on the database from design mode? I need the VB connection because the form has a lot of VB code attached to it that uses the database connection to update tables and things like that, but I also need to be able to switch from design mode to view mode and back again without getting this error.
Any ideas or suggestions are GREATLY appreciated.
Regards,
Amanda