Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid use of Null: 'Cint

Status
Not open for further replies.

mtrasp

Programmer
Jun 15, 2009
35
US
Hi i am getting this error

Invalid use of Null : Cint
in line 2 i.e If rs.Fields("CurrentInstallID").Value = "0". please help me
what may be the problem
This is my code:
If Not IsNull(rs.Fields("BuildOutputComponentID").Value) then
If rs.Fields("CurrentInstallID").Value = "0" _
Or CInt(rs.Fields("CurrentItemID").Value) = CInt(rs.Fields("DefaultItemID").Value) Then
%><%=Trim(rs.Fields("VersionNumber").Value)%>&nbsp;<font color="green">(Default)</font><%
elseif Cint(rs.Fields("CurrentInstallID").Value) > 0 then


'check to see if the component needs INF uploader for the specified component version
Set adoCmd = SetupProc("BuildSystem..pr_SelectExternalComponentVersionNumb er", connStandard)
AddParam adoCmd, "@externalcomponentversionid", adInteger, adParamInput, 0, Cint(rs.Fields("CurrentInstallID").Value)
Set rsNewInstallerVersion = CreateDisconnectedRS(adoCmd)
Set adoCmd = Nothing
 
you must specify a value when using cint(). You are using an OR clause in your code so

Code:
If rs.Fields("CurrentInstallID").Value = "0" _
Or CInt(rs.Fields("CurrentItemID").Value) = CInt(rs.Fields("DefaultItemID").Value)

so:

IF "CurrentInstallID" is not "0" then "CurrentItemID" AND "DefaultItemID" must contain a value, if they don't it will return an error.



--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Thank you very much .
i will find out the values in database
 
hi,

it is working ( no error ) when i removed Cint both sides.
am i doing correct? please tell me
 
I don't know if it is correct, is it working? Are you getting the desired result?

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
actually error came when i access the applictaion.after removing Cint the page is displaying all the needed results for specifying kitnumber. but i am not sure what happens in future for different kit numbers.

Thank you very much for your reply
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top