Corrupt DB??

  • Thread starter Secret Squirrel
  • Start date
S

Secret Squirrel

My database has been running using 2003 for almost 2 years now and the past
couple of days when you click to open a certain form the database closes
completely. Some users are using 2007 with the same database and I have no
problems with it. I have this code in the open event of this form and when I
remove it the form works fine. Why all of a sudden would this be causing a
problem? Could there be something corrupt with Access 2003? It works fine
with 2007. And it also works fine when I test it using 2003 on my laptop. But
the users that have 2003 are having this problem. Here's the code I'm using
that seems to be causing the problem:

If Len(Me.OpenArgs) > 0 Then
Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
Me![PO#].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![PONumber] &
Chr(34)
Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34) &
Chr(34)) & Chr(34)
Me![Qty].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)

End If
 
A

a a r o n _ k e m p f

yes, Jet corrupts-- too often for my liking.
have you considered upsizing?

-Aaron
 
S

Secret Squirrel

We are in the process of upgrading everyone to 2007 but there are a few users
that will be on 2003 for a few more months. Any way to fix this problem?

a a r o n _ k e m p f said:
yes, Jet corrupts-- too often for my liking.
have you considered upsizing?

-Aaron



My database has been running using 2003 for almost 2 years now and the past
couple of days when you click to open a certain form the database closes
completely. Some users are using 2007 with the same database and I have no
problems with it. I have this code in the open event of this form and when I
remove it the form works fine. Why all of a sudden would this be causing a
problem? Could there be something corrupt with Access 2003? It works fine
with 2007. And it also works fine when I test it using 2003 on my laptop. But
the users that have 2003 are having this problem. Here's the code I'm using
that seems to be causing the problem:

If Len(Me.OpenArgs) > 0 Then
Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
Me![PO#].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![PONumber] &
Chr(34)
Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34) &
Chr(34)) & Chr(34)
Me![Qty].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)

End If
 
K

Ken Snell \(MVP\)

It would be better if you run this code in the Load event of the form, not
the Open event. Many controls may not be instantiated during the Open event,
so it's best to use the later-occurring Load event instead.

Other than this, though, this code should not cause the form to close
spontaneously. So it's possible the data base or the form has become
corrupted. Try compact and repair of database. If that does not work, create
a new database and import all the data and objects into the new database.
 
A

Allen Browne

Suggestions

1. Your code will assign a zero-length string for some fields if the
frmARNCMR1 fields are null. That data type is inappropriate for Number,
Date, Currency, or Yes/No fields. Your code should test for null, and assign
the DefaultValue only if appropriate. (It should also test if frmARCMR1 is
open.

2. Make sure the database is split, so each user has her own local copy of
the front end, and there is no chance that the A2007 users are messing up
the binary for the A2003 users.

3. Cut the code, compact, decompile, compact again, paste the code into the
Load event, and compile using the target version (i.e. compile with A2003
for the A2003 users, and with A2007 for the A2007 users.)

An alternative approach might be to assign the values in Form_BeforeInsert
rather than set default values. Depends what you are doing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:D[email protected]...
 
S

Secret Squirrel

Thank you for your suggestions. I don't actually think this specific code is
causing the problem now. Whatever is corrupt seems to be moving through most
of the code in this particular form. I'm going to try and import everything
into a new database and see if that works. If not then I will have the final
users that are on 2003 upgraded to 2007. Question....I would assume something
is corrupt with office 2003 since that's where the problem lies. And plus it
works fine on my laptop using 2003. Will this problem migrate to 2007 or do
you think it's just with the 2003 version?

Allen Browne said:
Suggestions

1. Your code will assign a zero-length string for some fields if the
frmARNCMR1 fields are null. That data type is inappropriate for Number,
Date, Currency, or Yes/No fields. Your code should test for null, and assign
the DefaultValue only if appropriate. (It should also test if frmARCMR1 is
open.

2. Make sure the database is split, so each user has her own local copy of
the front end, and there is no chance that the A2007 users are messing up
the binary for the A2003 users.

3. Cut the code, compact, decompile, compact again, paste the code into the
Load event, and compile using the target version (i.e. compile with A2003
for the A2003 users, and with A2007 for the A2007 users.)

An alternative approach might be to assign the values in Form_BeforeInsert
rather than set default values. Depends what you are doing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
My database has been running using 2003 for almost 2 years now and the
past
couple of days when you click to open a certain form the database closes
completely. Some users are using 2007 with the same database and I have no
problems with it. I have this code in the open event of this form and when
I
remove it the form works fine. Why all of a sudden would this be causing a
problem? Could there be something corrupt with Access 2003? It works fine
with 2007. And it also works fine when I test it using 2003 on my laptop.
But
the users that have 2003 are having this problem. Here's the code I'm
using
that seems to be causing the problem:

If Len(Me.OpenArgs) > 0 Then
Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
Me![PO#].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![PONumber] &
Chr(34)
Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34) &
Chr(34)) & Chr(34)
Me![Qty].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)

End If
 
D

Dominic Vella

Is the database split and are you sharing the front end database?

ADOX library gets converted when using MS-Access2007 which then creates
problems when brought back into a 2003 environment.

Food for thought


Dom
 
A

Allen Browne

It the binary of the code is corrupt, you may import it into your new
database. You need to run the suggested compact, decompile, compact sequence
*before* you import into the new database.

I would suggest you run the first 5 steps of this recovery sequence first:
http://allenbrowne.com/recover.html

Then create the new blank database, turn off Name AutoCorrect, import, and
continue from step 6.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
Thank you for your suggestions. I don't actually think this specific code
is
causing the problem now. Whatever is corrupt seems to be moving through
most
of the code in this particular form. I'm going to try and import
everything
into a new database and see if that works. If not then I will have the
final
users that are on 2003 upgraded to 2007. Question....I would assume
something
is corrupt with office 2003 since that's where the problem lies. And plus
it
works fine on my laptop using 2003. Will this problem migrate to 2007 or
do
you think it's just with the 2003 version?

Allen Browne said:
Suggestions

1. Your code will assign a zero-length string for some fields if the
frmARNCMR1 fields are null. That data type is inappropriate for Number,
Date, Currency, or Yes/No fields. Your code should test for null, and
assign
the DefaultValue only if appropriate. (It should also test if frmARCMR1
is
open.

2. Make sure the database is split, so each user has her own local copy
of
the front end, and there is no chance that the A2007 users are messing up
the binary for the A2003 users.

3. Cut the code, compact, decompile, compact again, paste the code into
the
Load event, and compile using the target version (i.e. compile with A2003
for the A2003 users, and with A2007 for the A2007 users.)

An alternative approach might be to assign the values in
Form_BeforeInsert
rather than set default values. Depends what you are doing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
My database has been running using 2003 for almost 2 years now and the
past
couple of days when you click to open a certain form the database
closes
completely. Some users are using 2007 with the same database and I have
no
problems with it. I have this code in the open event of this form and
when
I
remove it the form works fine. Why all of a sudden would this be
causing a
problem? Could there be something corrupt with Access 2003? It works
fine
with 2007. And it also works fine when I test it using 2003 on my
laptop.
But
the users that have 2003 are having this problem. Here's the code I'm
using
that seems to be causing the problem:

If Len(Me.OpenArgs) > 0 Then
Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
Me![PO#].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![PONumber] &
Chr(34)
Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34)
&
Chr(34)) & Chr(34)
Me![Qty].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)

End If
 
S

Secret Squirrel

I followed your steps and I'm still getting the same issue. But the funny
part is when I run this DB on my laptop with 2003 it works fine but when I
run it on my desktop with 2003 it crashes. Wouldn't it crash no matter which
computer it was running on? Does that maybe lead to something wrong with the
version of access on my desktop instead of the actual DB itself?

Allen Browne said:
It the binary of the code is corrupt, you may import it into your new
database. You need to run the suggested compact, decompile, compact sequence
*before* you import into the new database.

I would suggest you run the first 5 steps of this recovery sequence first:
http://allenbrowne.com/recover.html

Then create the new blank database, turn off Name AutoCorrect, import, and
continue from step 6.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
Thank you for your suggestions. I don't actually think this specific code
is
causing the problem now. Whatever is corrupt seems to be moving through
most
of the code in this particular form. I'm going to try and import
everything
into a new database and see if that works. If not then I will have the
final
users that are on 2003 upgraded to 2007. Question....I would assume
something
is corrupt with office 2003 since that's where the problem lies. And plus
it
works fine on my laptop using 2003. Will this problem migrate to 2007 or
do
you think it's just with the 2003 version?

Allen Browne said:
Suggestions

1. Your code will assign a zero-length string for some fields if the
frmARNCMR1 fields are null. That data type is inappropriate for Number,
Date, Currency, or Yes/No fields. Your code should test for null, and
assign
the DefaultValue only if appropriate. (It should also test if frmARCMR1
is
open.

2. Make sure the database is split, so each user has her own local copy
of
the front end, and there is no chance that the A2007 users are messing up
the binary for the A2003 users.

3. Cut the code, compact, decompile, compact again, paste the code into
the
Load event, and compile using the target version (i.e. compile with A2003
for the A2003 users, and with A2007 for the A2007 users.)

An alternative approach might be to assign the values in
Form_BeforeInsert
rather than set default values. Depends what you are doing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
My database has been running using 2003 for almost 2 years now and the
past
couple of days when you click to open a certain form the database
closes
completely. Some users are using 2007 with the same database and I have
no
problems with it. I have this code in the open event of this form and
when
I
remove it the form works fine. Why all of a sudden would this be
causing a
problem? Could there be something corrupt with Access 2003? It works
fine
with 2007. And it also works fine when I test it using 2003 on my
laptop.
But
the users that have 2003 are having this problem. Here's the code I'm
using
that seems to be causing the problem:

If Len(Me.OpenArgs) > 0 Then
Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
Me![PO#].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![PONumber] &
Chr(34)
Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34)
&
Chr(34)) & Chr(34)
Me![Qty].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)

End If
 
C

Clif McIrvin

Secret Squirrel said:
I followed your steps and I'm still getting the same issue. But the
funny
part is when I run this DB on my laptop with 2003 it works fine but
when I
run it on my desktop with 2003 it crashes. Wouldn't it crash no matter
which
computer it was running on? Does that maybe lead to something wrong
with the
version of access on my desktop instead of the actual DB itself?


I've been following this thread in hopes that I'll learn useful stuff
for the future <grin>.

One point that I'm unclear on is the split status of your database; and
if split, where are the front ends?

It is possible that the FE on your desktop is corrupted.

Two additional points:

I've seen mention that A2007 modifies A2003 libraries, so if you use
2007 on your desktop, that could be a factor.

Also, have you verified the patch status of your desktop?
 
P

Pete D.

If you followed Allens suggestions and still have the problem then it must
be related to the computers that crash. This means time to check/compare
patches/updates/reference versions to see what versions are different.
Since you have your laptop working and desktop not that would be the place
to start. If you find something, please post it so we will all know. Pete
 
S

Secret Squirrel

We ended up reinstalling 2003 on the problem computers and all seems fine
now. Something must have been corrupted with that version of access. Good to
go now!
 
A

a a r o n _ k e m p f

who uses ADOX, anyways?

I've never had a need for it.

Loop through queries? Select Name From SysObjects Where Xtype in
('V','P')
Loop through tables? Select Name From SysObjects Where Xtype = 'U'
Create a Table? CREATE TABLE T1 AS...
Create an index? CREATE INDEX IX_PhoneList

I just really don't understand.. why anyone in their right mind..
would ever use ADOX for anything.

-Aaron






Is the database split and are you sharing the front end database?

ADOX library gets converted when using MS-Access2007 which then creates
problems when brought back into a 2003 environment.

Food for thought

Dom

My database has been running using 2003 for almost 2 years now and the
past
couple of days when you click to open a certain form the database closes
completely. Some users are using 2007 with the same database and I haveno
problems with it. I have this code in the open event of this form and when
I
remove it the form works fine. Why all of a sudden would this be causing a
problem? Could there be something corrupt with Access 2003? It works fine
with 2007. And it also works fine when I test it using 2003 on my laptop.
But
the users that have 2003 are having this problem. Here's the code I'm
using
that seems to be causing the problem:
   If Len(Me.OpenArgs) > 0 Then
       Me![RMA#].DefaultValue = Chr(34) & Me.OpenArgs & Chr(34)
       Me![Customer].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![Customer] & Chr(34)
       Me![PO#].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![PONumber] &
Chr(34)
       Me![PartNumber].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![CustomerPN].Column(1) & Chr(34)
       Me![DescriptionOfCondition].DefaultValue = Chr(34) &
Replace([Forms]![frmARNCMR1]![DiscrepancyDescription], Chr(34), Chr(34)&
Chr(34)) & Chr(34)
       Me![Qty].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![QtyRejected]
& Chr(34)
       Me![NCMR].DefaultValue = Chr(34) & [Forms]![frmARNCMR1]![NCMR] &
Chr(34)
       Me![WorkOrder].DefaultValue = Chr(34) &
[Forms]![frmARNCMR1]![WorkOrder] & Chr(34)
   End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top