Returns the last Advantage error message.
Syntax
string ads_errormsg( [int connection_id] )
Parameters
connection_id (I) |
Optional ID of a connection to the Advantage Database Server. |
Remarks
ads_errormsg returns a string containing the last error message if an error occurred or an empty string if no error occurred in last Advantage API that was performed. Unless a connection ID is specified, the last error message of any connection is returned.
Example
<?
echo "Connecting to a Server that does not exist.<br>\n";
echo "This connect should FAIL!<br>\n";
$rConn = ads_connect( "DataDirectory=\\\\NOServer\\NonExistantShare\\;ServerTypes=2", "", "" );
if ( $rConn == False )
{
$strErrCode = ads_error( );
$strErrString = ads_errormsg( );
echo "Connection failed: " . $strErrCode . " " . $strErrString . "<br>\n";
}
else
{
echo "Connection successful!<br>\n";
ads_close( $rConn );
echo "Connection closed<br>\n";
}
?>
See Also