Access 2007 at Odds with Vista

D

DudgeonousTweet

Open Access 2007 and save the blank database to the desktop. Rename it
mydatabase.accdb, and open it again and add one blank form, rename it
FirstStart. Go to the Visual Basic Editor and add the code:

Private Sub Form_Open(Cancel As Integer)
Application.Quit
End Sub

to the Microsoft Office Class Object Form_FirstStart.

Then go to Access Options and set up the program to display the form
FirstStart when the database is opened. Then exit Access and observe this
behavior:

When the icon for this accdb file is "double clicked", Vista throws the
"Windows cannot find this file..." error. When the icon for this accdb file
is right clicked and "Open" is selected, Vista again throws the "Windows
cannot find this file ..." error. When the icon for this accdb file is right
clicked and "Open With" is selected, and then Access 2007 is selected, the
file opens in Access and closes normally.

No amount of sleeping before or after the Quit has any influence on the
behavior. However, this code:

Private Sub Form_Open(Cancel As Integer)
MsgBox "Stop"
Application.Quit
End Sub

will open the file normally, throw up the MsgBox with the "Stop" string, and
will close normally when "OK" is selected.

This worked on Access 2003 on Windows XP.

This is rock solid reproducible (on my Lenovo T400). It fails the same way
when Vista comes up in a "clean boot".

This fails the same way when Access 2007 is operating on an mdb file in Vista.

Is this a known bug? If so could someone please direct me to the discussion
of this?

There is a lot of chatter on the web about this error. There is software
that can be downloaded. There are registry hacks. There are software
re-registrations. There are other things. If this is a bug, would someone
please say so. It may reduce the pressure on people to believe in a
misdiagnosis and do bad things to their systems.

Thank you.
 
A

AccessVandal via AccessMonster.com

No, I don’t have this error. (Vista SP 1 and Access2007 SP1.)

The database must be in the Trusted Location and the Vista user Desktop
folder must be the owner.

Make sure that you have 1 GB of RAM or more at least 2 GB.

What are the Access 2007 service packs and Vista service packs?
 
A

AccessVandal via AccessMonster.com

PS. Try using the form's timer event. Set the timer interval to "1000" or
"500" and from the Form_Timer "Application.Quit"
Open Access 2007 and save the blank database to the desktop. Rename it
mydatabase.accdb, and open it again and add one blank form, rename it
FirstStart. Go to the Visual Basic Editor and add the code:
snip..
 
D

DudgeonousTweet

Dear Mr. Vandal,

Thank you for your consideration of my problem.

I have Vista Home Basic SP 2 and Access2007 SP2.

Yes, I omitted the piece on the trusted location. Let me amend my recipe to
include that:

Open Access 2007 and save the blank database to the trusted directory
location. Rename it mydatabase.accdb. Open the file again and add one blank
form, rename it FirstStart. Go to the Visual Basic Editor and add the code:

Private Sub Form_Open(Cancel As Integer)
Application.Quit
End Sub

to the Microsoft Office Class Object Form_FirstStart.

Then go to Access Options and set up the program to display the form
FirstStart when the database is opened. Then exit Access and observe this
behavior:

When the icon for this accdb file is "double clicked", Vista throws the
"Windows cannot find this file..." error. When the icon for this accdb file
is right clicked and "Open" is selected, Vista again throws the "Windows
cannot find this file ..." error. When the icon for this accdb file is right
clicked and "Open With" is selected, and then Access 2007 is selected, the
file opens in Access and closes normally.

No amount of sleeping before or after the Quit has any influence on the
behavior. However, this code:

Private Sub Form_Open(Cancel As Integer)
MsgBox "Stop"
Application.Quit
End Sub

will open the file normally, throw up the MsgBox with the "Stop" string, and
will close normally when "OK" is selected.

This us of Application.Quit worked on Access 2003 on Windows XP.

This is rock solid reproducible (on my Lenovo T400). It fails the same way
when Vista comes up in a "clean boot".

This fails the same way when Access 2007 is operating on an mdb file in Vista.

In the above recipe I save the database to the trusted directory so that the
Desktop is completely out of the loop.

If there is an issue with the trusted directory being, or not being, the
"owner" of the database file, this is new to me. I don't know about a
directory "owning" something. If this is a possible issue could you direct
me to a site that would explain how I tell what directory is the "owner" of a
given file.

Yes, the system does have 2 Gb of RAM.

I put a 1 second sleep in before and after the Quit. It fails the same way.

The problem is very reliable on my system.

Thank you.
 
A

AccessVandal via AccessMonster.com

It was just to make sure that you had put it into a Trusted Location, as you
didn’t indicate that.

Right click on the folder where you put your database file – Properties –
Security tab – edit button or advanced button to check the user permissions.
http://windowshelp.microsoft.com/Windows/en-US/Help/7eccafae-4771-43d2-b19a-f4523f61babc1033.mspx


As you had put the file into Desktop folder, root directory of this folder is
"Users". It is not possible as some of the folders permission is not
accessible although you can still include the user name in the security tab.
The current user is not included in the security tab and "Everyone" user do
not have full permissions by default.

I think the problem lies with the loading up issues in Access 2007. As you
use the Startup Form to shutdown Access, it still loading up and your form is
forcing Access to shutdown.

Did you try the Form’s Timer event from my second post?
 
D

DudgeonousTweet

Dear Mr. Vandal,

Yes. Excellent. Thank you.

Your suggestion worked. Early on I had been suspicious that there was a
race condition between the Quit and the launch of Access, but my attempts to
confirm that failed because I used this structure to slow down the Quit:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Open(Cancel As Integer)
Sleep 1000
Application.Quit
End Sub

This did not cure the problem for any value on the sleep. In retrospect it
appears that this sleep slows down all threads related to the Access launch
and so it does not cause the launch thread to get finished before the Quit
thread starts.

I was unaware that the form had a timer before your suggestion. At your
suggestion I found the form timer in Help and substituted this structure for
the above:

Private Sub Form_Load()
Me.TimerInterval = 200
End Sub

Private Sub Form_Timer()
Application.Quit
End Sub

This works like a champ.

Since the original structure worked for Access 2003 running over XP it seems
that Access 2007 is faster than Access 2003, or Vista is slower than XP, or
both.

Or I suppose it might be that while Access 2003 and XP waited politely for
Access to be completely loaded before starting the Form_Open event handler
thread, Access 2007 and Vista are not as polite and go ahead and launch
Form_Open before Access is fully loaded.

Or something else.

My application now works. Thank you for your help.
 
D

DudgeonousTweet

Dear Mr. Vandal,

Yes. Excellent. Thank you.

Your suggestion worked. Early on I had been suspicious that there was a
race condition between the Quit and the launch of Access, but my attempts to
confirm that failed because I used this structure to slow down the Quit:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Open(Cancel As Integer)
Sleep 1000
Application.Quit
End Sub

This did not cure the problem for any value on the sleep. In retrospect it
appears that this sleep slows down all threads related to the Access launch
and so it does not cause the launch thread to get finished before the Quit
thread starts.

I was unaware that the form had a timer before your suggestion. At your
suggestion I found the form timer in Help and substituted this structure for
the above:

Private Sub Form_Load()
Me.TimerInterval = 200
End Sub

Private Sub Form_Timer()
Application.Quit
End Sub

This works like a champ.

Since the original structure worked for Access 2003 running over XP it seems
that Access 2007 is faster than Access 2003, or Vista is slower than XP, or
both.

Or I suppose it might be that while Access 2003 and XP waited politely for
Access to be completely loaded before starting the Form_Open event handler
thread, Access 2007 and Vista are not as polite and go ahead and launch
Form_Open before Access is fully loaded.

Or something else.

My application now works. Thank you for your help.
 

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

Top