Page 1 of 1 1
Topic Options
#180160 - 2007-09-05 03:12 PM catching sql error`s
AJ83 Offline
Fresh Scripter

Registered: 2007-08-23
Posts: 9
Loc: Amersfoort, The Netherlands
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?

Top
#180162 - 2007-09-05 03:41 PM Re: catching sql error`s [Re: AJ83]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
Yup, have a look at the object which you are using to access the data - it should have its own ".error" property or similar.
Top
#180354 - 2007-09-10 03:24 PM Re: catching sql error`s [Re: Richard H.]
AJ83 Offline
Fresh Scripter

Registered: 2007-08-23
Posts: 9
Loc: Amersfoort, The Netherlands
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?

Top
#180361 - 2007-09-10 06:02 PM Re: catching sql error`s [Re: AJ83]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I would recommend using the SQL UDFs that have been written for manipulation of the SQL Database.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 186 anonymous users online.
Newest Members
diefnet, Arogya, gkustra, emnipetro, Hirze
17644 Registered Users

Generated in 0.029 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org