jscript - "Unspecified Error" 80004005 when creating new Access database, only on another workstation -


what have jscript file gets called cscript, , script proof-of-concept creates new access 2007 format database, imports set of vba modules database, , runs subroutine imported modules.

this script works flawlessly on own computer. have office 2013 installed. however, brought script on coworker's machine , had him attempt running it. on machine, error looked like, createdb.js (22, 1): unspecified error , error code 80004005. code, below:

'use strict';  /**  * acnewdatabaseformat enumeration  * used newcurrentdatabase method specify database format of newly created database.  */ var acmodule = 5,     dbtext = 10,     acnewdatabaseformat = {         userdefault: 0,         access2000: 9,         access2002: 10,         access12: 12     };  var fs = new activexobject('scripting.filesystemobject'); var access = new activexobject('access.application'); var basepath = fs.getparentfoldername(wscript.scriptfullname); var db, prop, vcsfolder, fcur, module;  //create db , set superficial things. access.newcurrentdatabase(basepath + '\\importtest.accdb', acnewdatabaseformat.access12, null, "", ""); //access.opencurrentdatabase(basepath + '\\importtest.accdb'); db = access.currentdb(); prop = db.createproperty('apptitle', dbtext, 'my new database'); db.properties.append(prop); prop = db.createproperty('startupform', dbtext, 'main form'); db.properties.append(prop); db.properties('usemdimode') = 1;  //add msaccess-vcs modules vcsfolder = fs.getfolder(basepath + '\\msaccess-vcs'); fcur = new enumerator(vcsfolder.files); (; !fcur.atend(); fcur.movenext()) {     module = fcur.item().name.replace('.bas', '');     access.loadfromtext(acmodule, module, fcur.item()); }  access.run('importallsource'); access.quit(); 

line 22, character 1 access.newcurrentdatabase(basepath + '\\importtest.accdb', acnewdatabaseformat.access12, null, "", "");. office (and access!) 2007 installed on machine. tried other acnewdatabaseformats no luck. possibly issue here?

since you're not using of optional parameters, leave them off:

access.newcurrentdatabase(basepath + '\\importtest.accdb', acnewdatabaseformat.access12); 

you need specify value optional parameters if there other parameters want use later in argument list.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -