Errores solucionados, ahora solo funciona con access 2003

This commit is contained in:
Juan Ferrer Toribio 2017-09-25 13:34:25 +02:00
parent 1eed448800
commit e38a7e9820
1 changed files with 28 additions and 19 deletions

View File

@ -27,6 +27,8 @@ var Locale ={
"Cargando"
,"Error while updating":
"Error al actualizar"
,"Microsoft Access 2003 is not installed":
"Microsoft Access 2003 no está instalado en el sistema"
}
};
@ -185,12 +187,10 @@ var App =
_onKeyPress: function (e)
{
var target = event.target || event.srcElement;
switch (e.keyCode)
{
case 13: // Enter
this._onEnterPress (target);
this._onEnterPress (e);
break;
case 27: // Esc
window.close ();
@ -198,9 +198,11 @@ var App =
}
},
_onEnterPress: function (target)
_onEnterPress: function (event)
{
if ( target && target.id == 'user' && this.$('password').value == '')
var target = event.target || event.srcElement;
if (target && target.id == 'user' && this.$('password').value == '')
{
this.$('password').focus ();
return;
@ -354,7 +356,14 @@ var App =
{
var remember = this.$('remember').checked ? 1 : 0;
this.regWrite (Conf.regPath, 'remember', remember, 'REG_DWORD');
this.shell.run (this.mdbFile, 0, false);
var programFiles = this.getEnv ('ProgramFiles');
var accessBin = programFiles +'\\Microsoft Office\\OFFICE11\\MSACCESS.EXE';
if (!this.fso.fileExists (accessBin))
throw new Error (_('Microsoft Access 2003 is not installed'));
this.shell.exec ('"'+ accessBin +'" "'+ this.mdbFile +'"');
window.close ();
},