AJ83
(Fresh Scripter)
2007-09-05 03:12 PM
catching sql error`s

Hi,

Im building a program in kix/kixforms.net with alot of sql communication in it.

Especially while inserting data in a mssql database, i want to catch any problems. As of now, i can catch a problem with @error, but dont know what the problem is. Is there a way to get an errorcode from mssql when a problem arises?


Richard H.Administrator
(KiX Supporter)
2007-09-05 03:41 PM
Re: catching sql error`s

Yup, have a look at the object which you are using to access the data - it should have its own ".error" property or similar.

AJ83
(Fresh Scripter)
2007-09-10 03:24 PM
Re: catching sql error`s

Thanks for your reply. I have looked around on the internet, without much help.

ASE gives a error property for the following:

$cn = CreateObject("adodb.connection")
$cn.Errors

But how do i get usefull error messages back from the sql server?


Kdyer
(KiX Supporter)
2007-09-10 06:02 PM
Re: catching sql error`s

I would recommend using the SQL UDFs that have been written for manipulation of the SQL Database.

Thanks,

Kent