MartyConnelly
martyconnelly at shaw.ca
Fri Sep 29 00:25:40 CDT 2006
Just use the LoadFromText and SaveAsText commands to save the forms as text files and reLoad them in new mdb, that will definitely remove the security. To do the whole slew just use this code to place form text files in a temp directory. I have the reverse code somewhere. Also you could try running jetcomp.exe vs a copy of the mdw file just in case it is corrupted it is just another mdb file and run against the copy 'call as Save Objects("c:\temp\aob") Public Function SaveObjects(strPath As String) 'needs directory c:\temp\aob to be created to save text files ' or mkdir "c:\temp\aob Dim strName As String Dim objCollection As Object Dim aob As AccessObject 'check whether code ProjectType running in acMDB or acADP 'this affects what objects can be saved to text files Dim lmdbtype As Long lmdbtype = CurrentProject.ProjectType Debug.Print lmdbtype & " adp type" Select Case lmdbtype Case acMDB Set objCollection = CurrentProject.AllForms saveallobs objCollection, aob, strPath Set objCollection = CurrentProject.AllReports saveallobs objCollection, aob, strPath Case acADP Debug.Print "ADP" Case Else MsgBox "type not found" & lmdbtype End Select End Function Sub saveallobs(objCollection As Object, aob As AccessObject, _ strPath As String) Dim strMDB As String Dim strSplitPath As String For Each aob In objCollection Debug.Print aob.Type; aob.Name; " " & aob.DateModified Next aob For Each aob In objCollection strSplitPath = DescribeTempPath(strPath, aob.Type) SaveAsText aob.Type, aob.Name, strSplitPath & aob.Name & ".txt" End If Next aob End Sub Function DescribeTempPath(path As String, lobtype As Long) As String Dim strobtype As String Select Case lobtype Case acTable strobtype = "Tables" Case acQuery strobtype = "Queries" Case acModule strobtype = "Modules" Case acMacro strobtype = "Macros" Case acForm strobtype = "Forms" Case acReport strobtype = "Reports" Case acDataAccessPage strobtype = "DataAccessPages" Case Else strobtype = "Unknown" End Select Elam, Debbie wrote: >I have a database that I did not create that is secured with the standard >Access Security. Yesterday, I was asked to add a user to the security and >could not get or add data to the accounts. When I try to open it I get >errors saying Record(s) cannot be read; no read permission on MSysAccounts. >I get this 3 or 4 times and then it opens to the security window, but it is >blank and will not let me add data. > >I am guessing I would need to rebuild the security, and I actually took the >opportunity to get the database owners to agree to turn the security off in >favor of a few measures to prevent accidental intrusions which is really all >they needed. I imported the objects into a new database and thought I had >the security purged, but unfortunately the forms are secured just enough to >give errors when adding records. With the security messed up, I cannot even >look at the permissions, much less change them. I know the login I am using >has full permissions, but the program is not allowing them. Anyone know a >quick simple way to get rid of this? > >Debbie >- JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject >to the Attorney-Client Privilege, (2) an attorney work product, or (3) >strictly confidential. If you are not the intended recipient of this >message, you may not disclose, print, copy or disseminate this information. >If you have received this in error, please reply and notify the sender >(only) and delete the message. Unauthorized interception of this e-mail is a >violation of federal criminal law. >This communication does not reflect an intention by the sender or the >sender's client or principal to conduct a transaction or make any agreement >by electronic means. Nothing contained in this message or in any attachment >shall satisfy the requirements for a writing, and nothing contained herein >shall constitute a contract or electronic signature under the Electronic >Signatures in Global and National Commerce Act, any version of the Uniform >Electronic Transactions Act or any other statute governing electronic >transactions. > > -- Marty Connelly Victoria, B.C. Canada