Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Abend

Status
Not open for further replies.

ogri

Programmer
Sep 26, 2000
74
GB
Hi

I am having problems with Access 97. It was working fine before lunch, but coming back up went back into the database I was playing with and it will not load. I get a Dr Watson log generated with the message "Exception: access violation (0xc0000005), Address: 0x65102169".

I have tried loading Access and then repairing the database. This claims to work, but happens almost immediatly and seems to have no effect.

I have tried creating a new database and importing the components of the old one. This works fine for the actual tables. When I try and import either the forms or the modules it crashes out with the same error. I have tried importing them singly and selecting them all. There are no macros or queries, just a fair amount of VB code.

Any ideas? How can I get the code back?

All the best

Keith
 
You could try copying the database to another computer & opening it with that. We have a much less severe but similar problem, whereby any given connected computer cannot import objects from my computer. By copying the database containing the objects to another computer everyone can then import them....

This might just work for you James Goodman
j.goodman00@btinternet.com
 
Hi

Thanks for that. Unfortunatly it did not work. On a seperate computer it still failed with the same error

All the best

Keith
 
Is the code in modules or forms. You can get at the modules using the dbs.Containers!Modules.Documents(x) syntax.

If it's in forms, dbs.Containers!Forms.Documents(x)

Also, have you tried to import the objects from another open database using tools/import menu comand ?

I had been getting the exact same error. I found it was when I was trying to copy an object that already exsisted into another database. In other words, if the database I was copying to had a form frmNew, and I used VB and DoCmd.CopyObject acForm, frmNew, the error would generate.

One last thing, hold down the shift key as you open the corrupt database. This will bypass any startup commands that may be causing the error.

 
Hi

The code is in events when you use objects on the forms and also there is plenty more code in modules.

Using Import I can copy accross the tables with no problems, but any attempt to import a form or module results in the error, even when importing to a fresh blank Access database.

By the way, this is running under Windows NT

I have tried opening the database while holding down the shift key and this does not work (it still abends). Also I have tried using "msaccess /decompile c:\temp\tempdisp.mdb" (where that is a tempory copy of the database just to try this out on) and this also immediatly gives the error.

Not sure what you mean by the first paragraph. I cannot get into this database at all. Do you mean try to knock up an alternate access database with some code to try and import the old code?

All the best

Keith
 
Yeah, from a new database, do something like this:

Dim wrkJet As Workspace
Dim DBS as database
Dim i as integer
Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbs = wrkJet.OpenDatabase("Your bad database")
For i = 1 to dbs.Containers!Modules.Documents.count
msgbox dbs.Containers!Modules.Documents(i).name
Next i
Set dbs = nothing
set wrkJet = nothing
End Sub

The above code will return the names of all the Modules in the corrupt database in a message box, one at a time. Change the Modules to Forms & it'll do te same thong for the forms.

If that works, then knock out some code to get the stuff.

One last thing, the Mctrosoft Web site says for ACCESS.EXE access viloation error to install SP6A for Nt 4.0. Have you done that ?? (I have, and still get the message....)

If you find a solution that I didn't suggets, please let me know cuz I also get the error from time to time.



 
Hi

Thanks for that. It is finding the names of the modules and forms, although it comes out with a count of 5 but forms but cannot find the final form.It also cannot find the final module (I get "Item not found in this collection"). If I can retrieve them the missing ones are not too bad to rebuild (I have backups which are close to those)

However, this has put me totally out of my depth with Access. How can I try and retrieve the forms and save them from within the code?

All the best

Keith
 
My mistake

Change For i = 1 to dbs.Containers!Modules.Documents.count
To For i = 0 to dbs.Containers!Modules.Documents.count -1

To get the object(s) Repeat this for each one. Change the names and data types as applicable

DoCmd.TransferDatabase acImport, "Microsoft Access", "CorruptDB File & Path", acModule, "ModuleName", "ModuleName"
 
P.S.

You said you can get the tables. Why not just restore a backup copy that's got the code & import the up to date tabes into it ?
 
Hi

Trying that at the moment. Unfortunatly it seems to give the same error message as soon as it gets to the TransferDatabase line of the code

The problem is that the data is only test data which I do not care about. I am still developing the database processing. This has happened while I am writing the code. I do have a not too old backup, but that is still a few days work old. The app is to read in Excel spreadsheets and save the data onto tables from which it can be processed (and updated) and then eventually saved onto another spreadsheet to be emailed back to the the original person who sent it.

All the best

Keith
 
Oh, I forgot.

I can set up an object and assign the old form or module to it without an error. Can I then save this object as a form?

All the best

Keith
 
Hmmmmmmm.....

Are the spreadsheets linked ????

Can you clarify this <<I can set up an object and assign the old form or module to it without an error. Can I then save this object as a form?>> ??

How big is the database. Too large to E-mail ???

 
Hi

The Excel spread sheets are just read in. The idea is that the spreadsheets are received by email, loaded onto Access and processed there, then once all the data has been dealt with (could be a few days later with maybe a few dozen other spreadsheets processed in the mean time). The spreadsheets are just selected, validated and processed then forgotten about.

What I mean about saving the object off is as follows:-

Private Sub Command0_Click()
Dim wrkJet As Workspace
Dim DBS As Database
Dim i As Integer
Dim burt As Object
Dim burtModule As Access.Module
Set wrkJet = CreateWorkspace(&quot;&quot;, &quot;admin&quot;, &quot;&quot;, dbUseJet)
Set DBS = wrkJet.OpenDatabase(&quot;c:\temp\TempDisp.mdb&quot;)
For i = 1 To DBS.Containers!Modules.Documents.Count - 1
Set burt = DBS.Containers!Modules(i)
Set burtModule = CreateForm(, burt)
MsgBox DBS.Containers!Modules.Documents(i).Name
Next i
Set DBS = Nothing
Set wrkJet = Nothing
End Sub

The database is about 10mb, and local working practices mean that would not get out of the email system until about 2am. I have sent a copy home to try that on Access 97 running under Windows 98 (some of the online sources seemed to suggest this might be an NT problem which might be fine under 98) but that did not work. Another potential fix is to try using Access 2000 to load it.

Thanks for your help

All the best

Keith
 
Hey, I found something that might help. Check this out.

Private Sub TestModule()
Dim dbs As Database
Set dbs = CurrentDb
Dim i As Integer
Dim mdl As Module
Dim strMdl As String

Set mdl = Modules(0)
With mdl
i = .CountOfLines
strMdl = .Lines(1, i)
End With
MsgBox strMdl
End Sub
 
Hi

I tried playing with that using:-

Dim i As Integer
Dim fred As Integer
Dim mdl As Module
Dim strMdl As String
Dim appAccess As Access.Application

Set appAccess = New Access.Application
appAccess.OpenCurrentDatabase &quot;c:\temp\TempDisp.mdb&quot;
fred = appAccess.Application.Modules.Count
Set mdl = appAccess.Modules(0)
fred = appAccess.Application.Forms.Count
Set mdl = appAccess.Forms(0)

Set mdl = Modules(0)
With mdl
i = .CountOfLines
strMdl = .Lines(1, i)
End With
MsgBox strMdl

This does not work properly. Another Access app opens and it does (just about) manage to open the corrupt database. However the count of the Forms and the count of the Modules are both '0', so you cannot refer to any of the modules. Switching to the corrupt database in the Access app causes a Dr Watson report of an access violation error if you select any of the tables or you switch to the modules or forms tabs

Oh well, one last attempt is to try using Access 2000 to open the database. A few online sites suggest this as a possible fix for a corrupt database.

All the best

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top