creating accdb file from vb script

Keith McElroy
Keith McElroy used Ask the Experts™
I am attempting to build an accdb file from vb script and getting the following err.


I intent to run this on machines that do not have Access installed.  I tested on a machine that did have Access 2010 and still get the err.

VB Script:
strFileName = InputBox("Enter Access File Name",, "MyAccessDatabase")

Set objCatalog = CreateObject("ADOX.Catalog")

'objCatalog.Create "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE =" & strFileName & ".accdb" & ";"

Set objCatalog = Nothing

MsgBox "Done"

How can I overcome the err?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Microsoft Excel Expert
Top Expert 2014
you are probably running this from Windows 7 64 bit
Windows 7 doesn’t have a driver that will run VBS files in 64 bit, you need to make the vbs run in 32 bit. This can be accomplished by  opening your command prompt go on run and type cmd and then enter
then paste
%windir%\SysWoW64\wscript.exe C:\Users\yourmachineusername\Desktop\CreateBlankDatabase.vbs

Open in new window

and enter.  

you can change the "yourmachineusername" to your username and also the file path. the above one is assumed that file is in Desktop.

it will work.

let me know how it goes.


Yes, it works now, I also downloaded and installed the Microsoft Office Compatability Pack which seemed to help as well.  Thanks a bunch!
Professor JMicrosoft Excel Expert
Top Expert 2014

you are welcome Max. thanks for the feedback

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial