Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Nedd Help on With Error Message

0 views
Skip to first unread message

John Lane

unread,
Dec 24, 2009, 8:52:01 AM12/24/09
to
Below is VB code from a tiny little Access form. What it does is copies and
invokes thru the Shell command another Access accdb or mdb. Everything works
fine under Windows Vista. Under XP however, some time after the target accdb
is copied and invoked, the message “There was a problem sending the command
to the program.” is issued, and the info at the top of the message box is the
name of the accdb, CM_LDR.accdb. Notice I have an error handler and the
message isn’t coming from there. Also, if I un-comment the speech statement
everything work (no error message). Or, if in the target accdb, there is a
message box it works. I have no idea where the message is coming from. I
suspect there is some sort of race condition in XP and not in Vista causing
the message to be emitted from somewhere. Does anyone have anyone have a
clue as to what’s happening and/or how to make the error message go away?
Thanks.
--------------------------------------------------------------------------------------------------------------------------------------
Private Sub Form_Load()
On Error GoTo Err_Load
DoCmd.Hourglass True
StartLocalDatabase
DoCmd.Hourglass False
DoCmd.Quit
Exit_Load:
Exit Sub
Err_Load:
MsgBox Err.Number & " -- " & Err.DESCRIPTION
Resume Next
End Sub
---------------------------------------------------------------------------------------------------------------------
Private Sub StartLocalDatabase()
On Error GoTo Err_StartLocalDatabase
Dim strSourceLocation As String, strDestinationLocation As String
Dim strAccessDir As String, strCurrentDbDir As String
Dim retVal As Variant
Dim x As Long
Dim XL As Object
'Set XL = CreateObject("Excel.Application"
'XL.Speech.Speak " "
strNsb = "c:\THBRunTime\"
strCurrentDbDir = GetDBDir()
strSourceLocation = strCurrentDbDir & strDBFileName
strAccessDir = SysCmd(acSysCmdAccessDir)
'strDestinationLocation = strAccessDir & strDBFileName
strDestinationLocation = strNsb & strDBFileName
FileCopy strSourceLocation, strDestinationLocation ' Copy source to
target.
'Open the database and pass security params
DoEvents
For x = 1 To 10000000
Next x
retVal = Shell(strAccessDir & "Msaccess.exe """ & strDestinationLocation
& """", vbMaximizedFocus)
Exit_StartLocalDatabase:
Exit Sub
Err_StartLocalDatabase:
MsgBox Err.DESCRIPTION
'Resume Exit_StartLocalDatabase
End Sub

John Lane

unread,
Dec 24, 2009, 1:01:02 PM12/24/09
to
Egads. I noticed hunting around the internet that it may have to do with a
registry setting for HKE_CLASSES_ROOT\mdbfile\shell\open\ddeexec, or
something very similar for Access. Like I said, it doesn't generate the
message in Vista, so which registry setting does someone think it is for
Access 2007 on XP? Thanks.
0 new messages