*



You are watching: You attempted to open a database that is already opened by user

*

*
*

*
carolannpeacock.com Programmer Forums > Microsoft Office> Access and Access VBA> Access
*
Attempted to open up a database that is already open

|Search
Access Discussion of Microsoft Access database architecture and programming. See also the forums for Access ASP and Access VBA.
Welpertained to the carolannpeacock.com Forums. You are currently viewing the Access area of the carolannpeacock.com Programmer to Programmer discussions. This is a area of software program programmers and webwebsite developers including carolannpeacock.com book authors and readers. New member registration was closed in 2019. New short articles were shut off and the website was archived into this static format as of October 1, 2020. If you require technological support for a carolannpeacock.com book please contact http://hub.wiley.com

*
January 17th, 2004, 11:27 AM
person747
*

*
Attempted to open a database that is already open
Hello everyone Could you please help me through :When I tried open up recordcollection through ADO I obtained a message :" You attempted to open up a database that is currently opened solely by user "Admin" on machined "mymachine". Try again when the database is available". OS : Windows 98, Access 2000But on Windows 2000, Access 2000 I have message :"The database has actually been put in a state by user "Admin" on machinte "my machine" that prevents it from being opened up or locked"The just form which is open doesn"t have actually any type of subcreates and also does not open any other recordsetsThanks Serge
It sounds choose the security settings within the access table must be updated. Tright here may be a password and also uid that enables "admin" accessibility...if so, you need to incorporate this in the attach statementHope this helpsJohn
Your database might have actually been closed improperly and it is currently opened specifically by the previous user (perhaps you) if so, re-start the computer system. Or you are opening the database solely by default, in that case, go to devices, options , progressed and also make certain that your database default open mode is “shared”. If someone else has actually it opened exclusive, you will certainly have to wait until that individual closes the database.Sal
Thanks Sal for your aid.I tried to perform that way prior to , I mean as soon as I close database inside Access, than closed Access itself. And I checked if any type of ".ldb" file is opened, and also I rebegan computer too, but .... no luck.And in settings I have Open mode: "Shared", Record locking : " No Locks" , Open databases using record-level locking : "checked",Enable DDE refresh: "checked", yet again I obtained the exact same Post. :(Form from which I run the code doesn"t have actually any type of ADO connectionsAnd I am the only one user of this database on stand also along computer.--------------------------------------------------------Serge
Thanks John for your helpHow can I upday the protection settings within the access table?Tbelow is no password I"m only one user of this database as Admin.Any more ideas?ThanksSerge
Show all of your code. You may be locking the database another means. You might be trying to adjust an object inside the mdb efore you open the recordcollection.Sal


See more: Window Air Conditioner Smells Like Vinegar ? Ways To Fix It

Hi SalTright here is my code wbelow I obtained the difficulty on opening initially recordsetIt"s clumsy I recognize (I"m an amateur in databases :) )First recordcollection I want to make Disconnected just because I have to open various other recordset from the exact same table================================================Private Below cmdInsert_Click()Dim AptNum As StringDim Rent As CurrencyDim Park As CurrencyDim Misc As CurrencyDim SQLPrevMonth As StringDim SQLInsert As StringDim PrevMonth As StringDim MonthOfRent As DateDim PayDate As DateDim cnn1 As ADODB.ConnectionDim cnn2 As ADODB.ConnectionDim rs1 As ADODB.RecordsetDim rs2 As ADODB.RecordsetOn Error GoTo Err_cmdInsert_Click"---------------- asign Variables--------------------------MonthOfRent = DateAdd("m", 1, !!)PayDate = DatePrevMonth = !!SQLPrevMonth = "SELECT tbl_payments.apt_num, " & _" Max(tbl_payments.req_apt_rent) AS MaxOfreq_apt_rent, " & _" Max(tbl_payments.req_park_rent) AS MaxOfreq_park_rent, " & _" Max(tbl_payments.req_miscell) AS MaxOfreq_miscell " & _"FROM tbl_payments " & _"GROUP BY tbl_payments.apt_num " & _"HAVING (((Max(tbl_payments.req_apt_rent))>=700) " & _"AND((Max(tbl_payments.month_of_rent)) = " & PrevMonth & ")) " & _"ORDER BY tbl_payments.apt_num;"SQLInsert = "INSERT INTO tbl_payments " & _"(apt_num, month_of_rent, pay_date, req_apt_rent, req_park_rent,req_miscell) "SQLInsert = SQLInsert & " VALUES ("SQLInsert = SQLInsert & """ & AptNum & """SQLInsert = SQLInsert & ","" & MonthOfRent & """SQLInsert = SQLInsert & ","" & PayDate & """SQLInsert = SQLInsert & ","" & Rent & """SQLInsert = SQLInsert & ","" & Park & """SQLInsert = SQLInsert & ","" & Misc & """SQLInsert = SQLInsert & " )""----------------make first dislinked recordset ----------------On Error GoTo cnn1_ErrSet cnn1 = New ADODB.ConnectionWith cnn1.Setting = adModeShareExclusive.IsolationLevel = adXactIsolated.Provider = "Microsoft.Jet.OLEDB.4.0;".Open ""C:WINDOWSDesktopSuper Office 1.77.mdb", "admin", ""End WithSet rs1 = New ADODB.RecordsetWith rs1.CursorLocation = adUseClient.CursorType = adOpenStatic.LockType = adLockBatchHopeful.Open SQLPrevMonth, CurrentProject.ConnectionSet .ActiveConnection = NothingEnd Withcnn1.CloseSet cnn1 = Nothingcnn1_Err:If Not cnn1 Is Nopoint ThenSet cnn1 = NothingEnd IfMsgBox Err.DescriptionExit Sub"---------------------- Looop-----------------------Do Until rs1.BOFAptNum = rs1!apt_numRent = rs1!MaxOfreq_apt_rentPark = rs1!MaxOfreq_park_rentMisc = rs1!MaxOfreq_miscellOn Error GoTo cnn2_ErrSet cnn2 = New ADODB.ConnectionSet rs2 = New ADODB.RecordsetWith cnn2.Provider = "Microsoft.Jet.OLEDB.4.0;".Open "C:WINDOWSDesktopSuper Office 1.77.mdb", "admin", ""End Withrs2.Open SQLInsert, cnn2, adOpenKeyset, adLockOptimisticrs2.Closecnn2.CloseSet rs2 = NothingSet cnn2 = Nothingcnn2_Err:If Not cnn2 Is Nothing ThenSet cnn2 = NothingEnd IfMsgBox Err.DescriptionExit SubAptNum = ""Rent = 0Park = 0Misc = 0rs1.MoveNextLoop"--------------------end of the loop--------------------Exit_cmdInsert_Click:Exit SubMsgBox Err.DescriptionExit SubErr_cmdInsert_Click:MsgBox Err.DescriptionResume Exit_cmdInsert_ClickEnd Sub================================================== ======Actually all that code over is my attempt to insert a brand-new document in the table which would repeat the exact same worths in "Rent", "Park", "Misc" and also insert Next off "MonthOfRent".Could you suggest much better concept to overcome such logicThanks a lot for your helpSerge