Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Invalid Use of Null (Vista IIS7)

New Here ,
Nov 26, 2007 Nov 26, 2007
Hi All
Classic ASP
Vista Home Premium.

I have finally taken the leap and moved over onto a Vista dev PC and I am having a major headache with a site of mine.

The site has been working fine for the past 18 months on the XP dev PC but when I run it on the new Vista machine I get the following error;-

Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'Split'

/login.asp, line 91

The variable I am using the Split() function on is not null there is plenty of data in there and as I said the app has worked fine on the XP machine since it's inception.

I have to get this working as I have to dem the site on Wednesday to a potential client and the XP laptop is not available.

All help greatly appreciated.
Regards
Bren
TOPICS
Server side applications
764
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2007 Nov 26, 2007
"samspram" <webforumsuser@macromedia.com> wrote in message
news:fifd0h$7u6$1@forums.macromedia.com...
> Hi All
> Classic ASP
> Vista Home Premium.
>
> I have finally taken the leap and moved over onto a Vista dev PC and I am
> having a major headache with a site of mine.
>
> The site has been working fine for the past 18 months on the XP dev PC but
> when I run it on the new Vista machine I get the following error;-
>
> Microsoft VBScript runtime error '800a005e'
>
> Invalid use of Null: 'Split'
>
> /login.asp, line 91
>
> The variable I am using the Split() function on is not null there is
> plenty of
> data in there and as I said the app has worked fine on the XP machine
> since
> it's inception.
>
> I have to get this working as I have to dem the site on Wednesday to a
> potential client and the XP laptop is not available.
>
> All help greatly appreciated.
> Regards
> Bren

Is that value perhaps from a BLOB (Text, Image, Binary, Memo) column and are
you not using it in the same order in the page as it's defined in the
recordset or are you referencing the recordset column multiple times in the
page?

Here's an excerpt from the Microsoft Site
http://support.microsoft.com/support/kb/articles/q175/2/39.asp

When dealing with BLOB fields from Microsoft SQL Server, you must put them
to the right of non-BLOB columns in the resultset. To be safe, you should
also read the columns in left-to-right order, so if you have two BLOB
columns as the last two columns in your resultset, read the first one and
then the second. Do not read them in the reverse order.

http://databases.aspfaq.com/database/how-do-i-deal-with-memo-text-hyperlink-and-currency-columns.htm...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2007 Nov 26, 2007
Hi There
Thanks for the reply.
It is a MySQL DB, the fields I am referencing are TEXT datatypes and I have tried referencing them both left and right.
The SQL I use is SELECT * FROM tblusers WHERE etc etc
The data stored in the fields are comma separated strings e.g. 1, 2, 3, 4, which I am loading into Session variables at login with the following code:-
Session("allowedsubmenus") = Left(rsLogin.Fields.Item("u_allowed_sub_menus").Value, (Len(rsLogin.Fields.Item("u_allowed_sub_menus").Value) - 1))
Session("allowedtopmenus") = Left(rsLogin.Fields.Item("u_allowed_top_menus").Value, (Len(rsLogin.Fields.Item("u_allowed_top_menus").Value) - 1))
Session("allowedempmenus") = Left(rsLogin.Fields.Item("u_allowed_emp_menus").Value, (Len(rsLogin.Fields.Item("u_allowed_emp_menus").Value) - 1))
Session("allowedcoys") = Left(rsLogin.Fields.Item("u_allowed_companies").Value, (Len(rsLogin.Fields.Item("u_allowed_companies").Value) - 1))

If I load the data into a variable before performing the Left() function on the field then it goes past the lines OK but when I try and use the Session variable it then throws the Invalid Use of Null error again.
i.e.
Dim varNum
varNum = (Len(rsLogin.Fields.Item("u_allowed_top_menus").Value) - 1)
Session("allowedsubmenus") = Left(rsLogin.Fields.Item("u_allowed_sub_menus").Value, varNum)
Code will execute past the loading of sessions in this way but when I try to use the session later i.e. as with the Split() function I get the same error again.

Regards
Brendan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2007 Nov 26, 2007
LATEST


"samspram" <webforumsuser@macromedia.com> wrote in message
news:fifhoq$cr7$1@forums.macromedia.com...
> Hi There
> Thanks for the reply.
> It is a MySQL DB, the fields I am referencing are TEXT datatypes and I
> have
> tried referencing them both left and right.
> The data stored in the fields are comma separated strings e.g. 1, 2, 3, 4,
> which I am loading into Session variables at login with the following
> code:-
> Session("allowedsubmenus") =
> Left(rsLogin.Fields.Item("u_allowed_sub_menus").Value,
> (Len(rsLogin.Fields.Item("u_allowed_sub_menus").Value) - 1))
> Session("allowedtopmenus") =
> Left(rsLogin.Fields.Item("u_allowed_top_menus").Value,
> (Len(rsLogin.Fields.Item("u_allowed_top_menus").Value) - 1))
> Session("allowedempmenus") =
> Left(rsLogin.Fields.Item("u_allowed_emp_menus").Value,
> (Len(rsLogin.Fields.Item("u_allowed_emp_menus").Value) - 1))
> Session("allowedcoys") =
> Left(rsLogin.Fields.Item("u_allowed_companies").Value,
> (Len(rsLogin.Fields.Item("u_allowed_companies").Value) - 1))
>
> If I load the data into a variable before performing the Left() function
> on
> the field then it goes past the lines OK but when I try and use the
> Session
> variable it then throws the Invalid Use of Null error again.
> i.e.
> Dim varNum
> varNum = (Len(rsLogin.Fields.Item("u_allowed_top_menus").Value) - 1)
> Session("allowedsubmenus") =
> Left(rsLogin.Fields.Item("u_allowed_sub_menus").Value, varNum)
> Code will execute past the loading of sessions in this way but when I try
> to
> use the session later i.e. as with the Split() function I get the same
> error
> again.
>
> Regards
> Brendan

You are referencing the Recordset Column Value multiple times.
try putting it into a variable first

varValue = rsLogin.Fields.Item("u_allowed_sub_menus").Value

then proceed with your operations using that variable

Session("allowedsubmenus") = Left(varValue , (Len(varValue ) - 1))








Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines