stephenlecomptejr
asked on
running a Access 97 .mdb database through Visual Basic...still giving me -2147024894 cannot find file specified but exists!
I've got the following coding:
Dim Wsh As New WSHShell
'Set Wsh = CreateObject("WScript.Shel l")
Dim LocalDb As String
''set the localdb to the exact path and filename to the database you want opening
LocalDb = "C:\Fkpuds\Template\schedu lemaker.md b"
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:
C:\Fkpuds\Template\schedul emaker.mdb
When I do a print Dir(LocalDb), I get:
schedulemaker.mdb
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.
Dim Wsh As New WSHShell
'Set Wsh = CreateObject("WScript.Shel
Dim LocalDb As String
''set the localdb to the exact path and filename to the database you want opening
LocalDb = "C:\Fkpuds\Template\schedu
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:
C:\Fkpuds\Template\schedul
When I do a print Dir(LocalDb), I get:
schedulemaker.mdb
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER