Print Page | Close Window

Access to MsSql – Receives Invalid use of Null

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=25528
Printed Date: 30 March 2026 at 8:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Access to MsSql – Receives Invalid use of Null
Posted By: Andreas.E
Subject: Access to MsSql – Receives Invalid use of Null
Date Posted: 03 April 2008 at 8:46am

Hi

I have recently convert my Access DB up to MsSql and done the necessary changes to connect to the SQL DB. All that, went just fine.

The forums, and topics are fully readable, but are not able to post anything. When I press “Post” I end up with the following error:

 
Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'CBool'

/_forum_beta/forum_posts.asp, line 310

Any help is much appreciated Clap


Small update
The error only occurs when posting a new topic in any forum. Reply in already existing topic, works fine.

Line 310 in forum_posts.asp:
    'Read in the topic details
    lngPollID = CLng(rsCommon("Poll_ID"))
    strSubject = rsCommon("Subject")
    strTopicIcon = rsCommon("Icon")
    blnTopicLocked = CBool(rsCommon("topicLocked"))
    intPriority = CInt(rsCommon("Priority"))

-----
FUNCTION OF CBool
Description
Returns an expression that has been converted to a Variant of subtype Boolean.
Syntax
CBool(expression)

The expression argument is any valid expression.

Remarks
If expression is zero, False is returned; otherwise, True is returned. If expression can't be interpreted as a numeric value, a http://www.csidata.com/custserv/onlinehelp/VBSdocs/vbs0.htm#defRTErr - run-time error occurs.

-----





Replies:
Posted By: WebWiz-Bruce
Date Posted: 03 April 2008 at 10:08am
The only line calling CBool from there is:-

blnTopicLocked = CBool(rsCommon("topicLocked"))

Seems odd that you are getting this error, often strange errors are a result of corrupted files. The first thing to try is to try reuploading the original files again and see if that fixes the issue.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: oorubenoo
Date Posted: 15 July 2016 at 10:10pm
Since i'm running into the same error I  unsimplified CBOOL and put it into a If Else statement. Worked for me.


If isNull(rsCommon("topicLocked")) Then
blnTopicLocked = 0
Else
blnTopicLocked = rsCommon("topicLocked")
end if




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net