Thanks for your advice. ADODB link http://adodb.sourceforge.net/ Please use reply all to send your message to the list ----------------------------------------- in my experience is better to use an abstraction layer library like adodb this will allow you to switch database in the future, besides that provides error control and debug options and it is extremly easy to develop with. Luck! I have looked in the online manual but am not able to find the equivalent functions in mssql of mysql_errno() & mysql_error(). I am in the unfortunate position of having to develop using an existing MSSQL database. There aren't any as far as I know. I think the best you can do is test for the existence of whatever you are looking for (connection, result set etc) at each stage and do something graceful. Not much use for debugging though.