Forums

ASP

This topic is locked

New Error!

Posted 09 Oct 2001 11:09:16
1
has voted
09 Oct 2001 11:09:16 simon bloodworth posted:
First i would like to thank everyone who helped in my struggle to sort my connection problems as i am now there.
But i now have a new problem. It is accessing the database fine but on some of the results when i click to go to the detail page it gives me the error
Vbscript Runtime error 'ASP 0185 : 94'
Invalid use of Null: 'CStr'

/mainresults.asp,line 63

i have no idea what this is and it only gives it on some of the results but others go to the detail page fine.

Please Help

Thanks

S Bloodworth

Replies

Replied 10 Oct 2001 18:59:22
10 Oct 2001 18:59:22 Joel Martinez replied:
that simply means that you have nulls in your database... the cstr() function can't handle them.

you can do one of several things: <ul><li>Update all the fields in the db with an empty string (''), and place a default value of '' on that field... thus eliminating nulls from the equation</li><li>put handler code on the error line that looks something like this:
IF NOT IsNull(recordset1.fields("thefield".value) THEN cStr(recordset1.fields("thefield".value)</li></ul>I personally would go for the first option, but it all depends on what your app needs.

Joel Martinez [ ]
----------
E-Commerce Concepts with Ultradev...pre-order yours at
www.basic-ultradev.com/ecomm_concepts/

Reply to this topic