#######################################################################
# Response Statements for Connecting and Disconnecting to the Database
#######################################################################
include esqlca.inc
include esqlda.inc
include edb2.inc
stimulus DB "EDB2"
string Database_SV
UserId_SV
Message_SV
Password_SV
integer Mode_IV
response to start
copy "SAMPLE" to Database_SV
copy "AUser" to UserId_SV
copy "ThePassWord" to Password_SV
copy SQL_USE_SHR to Mode_IV
call EDB2StartDBM()
call EDB2Connect(Database_SV,
UserId_SV,
Password_SV,
Mode_IV,
Esqlca)
begin guarded
response to stimulus DB EDB2_ERROR
# If EDB2_ERROR stimulus is received call the subroutine EDB2Error to
# copy the contents being held in Esqlca to the string Message_SV.
call EDB2Error(Message_SV, Esqlca)
send "ED2Error is : " Message_SV "\n" to errorlog
leave block
response to stimulus DB EDB2_STARTED
# If the EDB2_STARTED stimulus is received the call to EDB2Connect was
# successful. Any other application logic can be placed here.
leave block
end
response to item Exit_MC
call EDB2Disconnect(Esqlca)