Hi Jim,
SQLGetDiagrec and SQLGetDiagField commands seem to be for diagnosing errors associated with a database record as RecNumber needs to be provided as one of the parameters. I am not sure if there is a diagnostic command to show details on this issue of database connection error.
Thanks.