Possible Corruption

  • Thread starter Thread starter Tom Collins\(Home\)
  • Start date Start date
T

Tom Collins\(Home\)

I have 2 access 2000 databases that I suspect may be corrupted.

My experience in the past is that if I copied any object from an old
database to a new one, then the corruption could also be copied, so if
I wanted to be 100% sure it was clean was to export the data as text,
export the VBA code as text, rebuild the other the forms & reports
manually in a new database, import the data & VBA code into the new
database.

Exporting the data & VBA is easy enough, but rebuilding the others is
a pain. I could write a program that would look at each object and
it's properties and write a mirror image into the new database. I
already wrote something similar for Excel in the past. However, I
don't have the time to do this for Access.

Does anyone know of a service or software that does? All I can find
are companies that repair/restore tables. I can do that myself. What I
want is a service that rebuilds the forms & reports in a new database
by creating each object and assigning each property one at a time. I
don't want the whole objects just copied. I need to be 100% sure it's
clean before we start modifying them.

I know that 95% of the corruption problems come from the tables, but I
have seen corrupted forms & reports also.


If you can help, please email me. Thanks.

Tom Collins

tom_collins[at]bellsouth.net

(replace the [at] with @ to email me)
 
Does anyone know of a service or software that does?

There are the UNDOCUMENTED - and unsupported, so no guarantees! -
Application.SaveAsText and Application.LoadFromText methods of Access.
In practice, for A2000 through A2003, in my experience they work well
and can indeed help clean up databases.

The syntax in VBA is

Application.SaveAsText(vbDataForm, "frmMyForm",
"H:\path\frmMyForm.txt")

and identiacally for LoadFromText. This will save (afaik) any object -
tables, forms, queries, reports, modules.


John W. Vinson[MVP]
 
John Vinson said:
The syntax in VBA is

Application.SaveAsText(vbDataForm, "frmMyForm",
"H:\path\frmMyForm.txt")

and identiacally for LoadFromText. This will save (afaik) any object -
tables, forms, queries, reports, modules.

I think that's a typo. Shouldn't that be "acForm", not "vbDataForm"?
"acDataForm" is the same as "acForm", in fact, but the intellisense
dropdown lists "acForm", "acReport", "acTable", "acQuery", "acModule",
etc.
 
I think that's a typo. Shouldn't that be "acForm", not "vbDataForm"?
"acDataForm" is the same as "acForm", in fact, but the intellisense
dropdown lists "acForm", "acReport", "acTable", "acQuery", "acModule",
etc.

Sorry! In my testing, intellisense offered acDataForm (not
vbDataForm). Why the "data" got in there I don't know, but in 2002 and
2003, it did.

John W. Vinson[MVP]
 
John Vinson said:
Sorry! In my testing, intellisense offered acDataForm (not
vbDataForm). Why the "data" got in there I don't know, but in 2002 and
2003, it did.

Very interesting! I checked with Access 2002, and intellisense offered
me "acForm", not "acDataForm". We must have different versions of some
library.
 
Perfect!!
I tried it on a test DB and it works. I hadn't heard about this 'feature'
before. Even if it errors on 1 form because of corruption, I can manually
mirror just 1 easy enough. This will make my life easier.

Thanks

Tom Collins
 
Tom Collins said:
I tried it on a test DB and it works. I hadn't heard about this 'feature'
before. Even if it errors on 1 form because of corruption, I can manually
mirror just 1 easy enough. This will make my life easier.

Sample code at http://www.datastrat.com/Code/DocDatabase.txt

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Back
Top