Hi Friends,
I am trying to connect to a database named "archive". This database is available in some hosts and not available in others.
The connect statement below tries to connect to the "archive" database and returns the message as "connected" if the database connetion happens successfully.
If the the connect statement is not able to connect to the database for some hosts then it hangs for a long time then terminates with message ** Could not connect to server for database <DATABASE>, errno <ERRNO>.
It does not show it the database is connected or not with this scenario.
Now My question: Is it possible to set a timeout CONNECT Statement.
i.e. if the connect statement runs for a specified period of time then stop connecting to the dabase. I don want the system to hand for a long time bcos of connect statement.
def var mDBConnectString as char.
mDBConnectString = "archive" + " -S " + "ta1-arch1" + " -H " + "hostname".
message "connecting" view-as alert-box.
CONNECT VALUE(mDBConnectString).
IF CONNECTED ('archive') then message "connected" view-as alert-box.
ELSE message "not connected" view-as alert-box.
Thanks In Advance,
Rgds,
Sandeep
I am trying to connect to a database named "archive". This database is available in some hosts and not available in others.
The connect statement below tries to connect to the "archive" database and returns the message as "connected" if the database connetion happens successfully.
If the the connect statement is not able to connect to the database for some hosts then it hangs for a long time then terminates with message ** Could not connect to server for database <DATABASE>, errno <ERRNO>.
It does not show it the database is connected or not with this scenario.
Now My question: Is it possible to set a timeout CONNECT Statement.
i.e. if the connect statement runs for a specified period of time then stop connecting to the dabase. I don want the system to hand for a long time bcos of connect statement.
def var mDBConnectString as char.
mDBConnectString = "archive" + " -S " + "ta1-arch1" + " -H " + "hostname".
message "connecting" view-as alert-box.
CONNECT VALUE(mDBConnectString).
IF CONNECTED ('archive') then message "connected" view-as alert-box.
ELSE message "not connected" view-as alert-box.
Thanks In Advance,
Rgds,
Sandeep