Batch file that detects for connection problems

By: Quinn Wildman

Abstract: Batch file that only works on NT, 2000 or XP which hopes to identify simple connection problems

This batch will detect the following possible problems:
  • Licensing problems
  • Server not started
  • Network problems

Read the rem and echo statements to get a complete understanding of what this batch file does.


@echo off if %os%==Windows_NT goto :OK goto :bados :OK setlocal rem change next line to where you have interbase installed if not the default set ibdir="c:\program files\borland\interbase\bin" rem change next line to user than can connect to database set ISC_USER=sysdba rem change next line to password that can connect to database set ISC_PASSWORD=masterkey rem change next line to a drive you are not using, and higher than lastdrive setting set drive=x rem next line could be changed to indicate where your database is set dbdir=..\examples\database pushd %ibdir% subst %drive%: %cd% rem cd to interbase example database directory cd %dbdir% echo exit;>exit.sql echo trying local connection echo If this fails, server is probably not started. echo However, it could be a licensing problem too. for %%f in (*.gdb) do %drive%:isql %%f -i exit.sql echo trying network connection via localhost echo if this fails, probably licensing problem for %%f in (*.gdb) do %drive%:isql localhost:%cd%\%%f -i exit.sql echo trying network connection echo if this fails, network problem for %%f in (*.gdb) do %drive%:isql %computername%:%cd%\%%f -i exit.sql popd goto :done :bados echo This batch file is not supported on your OS :done

Server Response from: ETNASC03