Link to home
Start Free TrialLog in
Avatar of JoGeek
JoGeek

asked on

Errorhandling by using the shell-function!!!

Hello,
i have to make a backup-/restoreroutine for firebird/interbase-dbs!
In vb I use the shell-function to call the programm gbak (programm for backup/restore firebird-dbs)
but i have to know, if the routine has occure an error in some way!! (you don't get the errormessages, you get in the cmd).
the vb-programm easily goes to the next command and doesn't matter what's happened in the cmd-routine!!

Is there any way to know, if the shell-function has occured an error???????




Thanx in advance
JoGeek
Avatar of leonstryker
leonstryker
Flag of United States of America image

there is some errorlevel handling that you can use but it would be very rudimentary
source : http://www.rootshell.be/~jouell/nt/shell.html

you could also try to use a vbs script instead of a shell script if your situation allows for that
source : http://www.computerperformance.co.uk/ezine/ezine15.htm
ASKER CERTIFIED SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JoGeek
JoGeek

ASKER

This function is really great, thank you!
But my command returns an error despite the fact that directly on the cmd it works:-\

Well, here's the command:
C:\Programme\Firebird\Firebird_1_5\bin\gbak -V   -T  -user "SYSDBA" -password "masterkey" localhost:"C:\test.fdb" "C:\test.fdb.fbk"

The errormesage is:
gbak: ERROR: Unable to complete network request to host "localhost".
gbak: ERROR:     Failed to locate host machine.
gbak: ERROR:     The specified name was not found in the hosts file or Domain Name Services.
gbak: Exiting before completion due to errors

Strange is, that, if i leave out the "localhost": , it works fine!!!


What could be the problem??


with kind regards,
JoGeek

Avatar of JoGeek

ASKER

Okok, it was a fault of gbak:\
Does somebody knows, how gbak can work with mapped devices?????


Thanx,
JoGeek