running a Access 97 .mdb database through Visual Basic...still giving me -2147024894 cannot find file specified but exists!
Posted on 2005-05-02
I've got the following coding:
Dim Wsh As New WSHShell
'Set Wsh = CreateObject("WScript.Shell")
Dim LocalDb As String
''set the localdb to the exact path and filename to the database you want opening
LocalDb = "C:\Fkpuds\Template\schedulemaker.mdb"
Wsh.Run "msaccess""" & LocalDb & "", WshMaximizedFocus
Set Wsh = Nothing
to open up and run an Access 97 database.
I get a Run-time 'error' -2147024894 error: Automation error: the System cannot find file specified.
with the highlight on Wsh.Run "msaccess""" & LocalDb & "", WshMaximizedFocus
When I do a print LocalDb, I get:
When I do a print Dir(LocalDb), I get:
When I go to Windows Explorer and click on all the folders and subfolders - I can see the file present.
All I want to do is run this .mdb database. There is a form startup that runs all kinds of macros...I even took off the startup form and it still does not see it. The .mdb database is not read-only nor is the folder.
It's just real frustrating that its there and not working.
Is there another set of code that I can use in Visual Basic to make this access database pull and run?
Thank you in advance for all replies.