Link to home
Start Free TrialLog in
Avatar of phmurphy
phmurphyFlag for United States of America

asked on

ACCESS 2007 Runtime Security Problem

I have an ACCESS Form that I have packaged as a RunTime and it works perfectly on the computer where it was created.  This computer has Office 2007 Pro.  When I install the package that includes the runtime files on computer with Office 2003 Pro it opens with a security warning that I would like to get rid of, but more importantly the program crashes when it tries to export a set of tables to an /mdb file.  See the code below.   I suspect there might be a write permission thing going on.

Thanks,
Pat
Private Sub cmdExportMDB_Click()
'This refresh is necessary since the refresh rate is the frequency of saving changes back to the table.
'The default refresh rate can be set by the user but the default value is 60 seconds so if the data are
'copies to a file less than 60 seconds after a change, the change does not occur in the output file.
Me.Refresh
Dim db As DAO.Database
'create a string variable to use as a test for the presence of the WF87Link.mdb file
Dim TestLinkFile As String
'If the file exists, DIR will return the file name, if not it will be a blank string
TestLinkFile = Dir("C:\WetForm\WF87Link.mdb")
'This tests for the existence of the file, if the file doesn't exist then it is created.
If TestLinkFile = " " Then
Set db = CreateDatabase("C:\WetForm\WF87Link.mdb", dbLangGeneral, dbVersion40)
db.Close
Set db = Nothing
End If

Open in new window

Avatar of phmurphy
phmurphy
Flag of United States of America image

ASKER

Perhaps it isn't a write permission issue because I can export a table as a spreadsheet without a problem.  The actual error is "Execution of this application has stopped due to a run-time error - The application can't continue and will be shut down".  This does not happen on the desktop where the runtime was created.

Thanks,
Pat
I have now run the database (by opening it on the other computers after changing the extension to .mdb) and the program fails because the target file wasn't created.  Is there some reason that the createdatabase would work on one machine but not the others?

Thanks,
Pat
HI all,
I am narrowing the problem down.  It must have something to do with the if statement, because if I remove the if statement the target file is created just fine.  The problem is the if statement.  But exactly what the problem is I don't know.

Thanks,
Pat
ASKER CERTIFIED SOLUTION
Avatar of phmurphy
phmurphy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial