Type Mismatch

Results 1 to 3 of 3

Thread: Type Mismatch

  1. #1
    Trina Guest

    Default Type Mismatch

    Hi<BR><BR> When I run the script below, it&#039s give me the follwing error:<BR><BR> Microsoft VBScript runtime error &#039 800a000d&#039 <BR><BR>Type mismatch: &#039Ubound&#039 <BR><BR>/test1b.asp, line 23 <BR><BR><BR>The script:<BR><BR> &#060;% <BR><BR><BR>UserArray = session("Users")<BR><BR><BR>nextelement = Ubound(UserArray,2) + 1<BR><BR>Redim Preserve UserArray(5, nextelement)<BR><BR>UserArray(0, nextelement) = request("firstname")<BR>UserArray(1, nextelement) = request("lastname")<BR>UserArray(2, nextelement) = request("city")<BR>UserArray(3, nextelement) = request("state")<BR>UserArray(4, nextelement) = request("zip")<BR><BR>UserArray = session("Users")<BR><BR><BR>session("Users") = UserArray<BR>%&#062;<BR><BR><BR>Appreciate if anyone can help. Thanks<BR> <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Type Mismatch

    Are you 100% sure that Session("Users") contains a valid, 2d array? You should always do an If statement testing IsArray before using UBound.<BR><BR>For example:<BR><BR>IF IsArray(Session("users")) then<BR><BR>UserArray = session("Users")<BR>nextelement = Ubound(UserArray,2) + 1<BR><BR>else<BR><BR>Response.Write "Session(""Users"") is not a valid array!"<BR><BR>end if

  3. #3
    Trina Guest

    Default RE: Type Mismatch

    Hi,<BR> <BR> Thanks for your prompt reply. I just want to find out how to define an array with session??? In another word, I want to store Session("User") into an array.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts