Microsoft VBScript runtime error '800a01b6' | | | Join Date: Feb 2010 Location: Coimbatore
Posts: 9
| | Microsoft VBScript runtime error '800a01b6'
Object required for 'Session(...)'
/OnlineBookStore/AddItemProcess.asp, line 33
I have underlined the error line
Code i Used: -
<%
-
Dim StrTechName, StrBookName, StrISBN, StrPrice, IntQuantity,
-
IntCounter, IntCount, IntShowCounter, IntItemID, BlnDuplicate,
-
IntTotalItems, DblTotalPrice, DblFinalPrice
-
-
StrTechName = Trim(Request.Form("TechName"))
-
StrBookName = Trim(Request.Form("BookName"))
-
StrISBN = Trim(Request.Form("ISBN"))
-
StrPrice = Trim(Request.Form("Price"))
-
IntQuantity = Trim(Request.Form("TxtQuantity"))
-
-
IF Session("LoginBuyer") = "" OR Session("LoginUser") = "" Then
-
Response.Redirect("Default.asp")
-
END IF
-
-
BlnDuplicate = False
-
-
IntCount = CInt(Session("TotalItems"))
-
-
IF IntCount > 0 Then
-
For IntCounter = 1 to IntCount
-
IF Session("MyItems")("ISBN" & IntCounter) = StrISBN And Session
-
("MyItems")("Purchase" & IntCounter) = "yes" Then
-
BlnDuplicate = True
-
Exit For
-
END IF
-
Next
-
END IF
-
-
IF BlnDuplicate = True Then
-
IntQuantity = IntQuantity + CInt(Session("MyItems")("Quantity" &
-
IntCounter))
-
Session("MyItems")("Quantity" & IntCounter) = IntQuantity
-
ELSE
-
IntItemID = CInt(Session("TotalItems"))
-
IntItemID = IntItemID + 1
- Session("MyItems").Add "BookName" & IntItemID, StrBookName
-
Session("MyItems").Add "ISBN" & IntItemID, StrISBN
-
Session("MyItems").Add "Price" & IntItemID, StrPrice
-
Session("MyItems").Add "Quantity" & IntItemID, IntQuantity
-
Session("MyItems").Add "Purchase" & IntItemID, "yes"
-
Session("TotalItems") = Session("TotalItems") + 1
-
END IF
-
%>
-
-
<table border="0">
-
<tr>
-
<td><h3><font face="verdana, arial" color="darkblue">Item Added In
-
Your Cart!</font></h3></td>
-
</tr>
-
</table>
-
<hr color="black" noshade>
-
<table border="0">
-
<tr>
-
<td class="SimpleText">You are in <b><%= StrTechName %></b>
-
category.</td>
-
</tr>
-
</table>
-
<table border="1" bordercolor="lightgrey" style="border-
-
collapse:collapse">
-
<tr>
-
<td class="SimpleText"><b>Book Name</b></td>
-
<td class="SimpleText"><b>ISBN</b></td>
-
<td class="SimpleText"><b>Quantity</b></td>
-
<td class="SimpleText"><b>Price</b></td>
-
<td class="SimpleText"><b>Total Price</b></td>
-
<td class="SimpleText"><b>Option</b></td>
-
</tr>
-
<%
-
IntCount = CInt(Session("TotalItems"))
-
For IntShowCounter = 1 to IntCount
-
IF Session("MyItems")("Purchase" & IntShowCounter) = "yes" Then
-
IntTotalItems = IntTotalItems + 1
-
DblTotalPrice = CDbl(Session("MyItems")("Price" & IntShowCounter) *
-
CInt(Session("MyItems")("Quantity" & IntShowCounter)))
-
DblFinalPrice = DblFinalPrice + CDbl(DblTotalPrice)
-
%>
-
<tr>
-
<td class="SimpleText"><%= Session("MyItems")("BookName" &
-
IntShowCounter) %></td>
-
<td class="SimpleText"><%= Session("MyItems")("ISBN" &
-
IntShowCounter) %></td>
-
<td class="SimpleText"><%= Session("MyItems")("Quantity" &
-
IntShowCounter) %></td>
-
<td class="SimpleText"><%= Session("MyItems")("Price" &
-
IntShowCounter) %></td>
-
<td class="SimpleText"><%= CDbl(DblTotalPrice) %></td>
-
<td><a href="RemoveItem.asp?ISBN=<%= Session("MyItems")("ISBN" &
-
IntShowCounter) %>" class="NormalLink">Remove Item</a></td>
-
</tr>
-
<%
-
END IF
-
Next
-
%>
-
</table>
-
<hr color="black" noshade>
-
<table border="1" bordercolor="lightgrey" style="border-
-
collapse:collapse">
-
<tr>
-
<td class="SimpleText">Total items in your cart: <b><%=
-
IntTotalItems %></b></td>
-
</tr>
-
<tr>
-
<td class="SimpleText">Total cost of all items: <b><%= CDbl
-
(DblFinalPrice) %></b></td>
-
</tr>
-
<%
-
IF IntTotalItems > 0 Then
-
%>
-
<tr>
-
<td><a href="SubmitOrder.asp" class="NormalLink">Submit My Order</
-
a></td>
-
</tr>
-
<%
-
END IF
-
%>
-
</table>
-
Please guys get me the solution for this...
Its urgent...
|  | | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,967
| | | re: Microsoft VBScript runtime error '800a01b6'
I don't see anything underlined. Where is the error?
Jared
|  | | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,967
| | | re: Microsoft VBScript runtime error '800a01b6'
Pls See the line 37
Session("MyItems").Add "BookName" & IntItemID, StrBookName
Sir, Now it show the following error
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
Technical Information (for support personnel)
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Session(...)'
/tilak/AddItemProcess.asp, line 37
Browser Type:
Opera/9.63 (Windows NT 5.1; U; en) Presto/2.1.1
Page:
POST 90 bytes to /tilak/AddItem.asp
POST Data:
TechName=Nokia&BookName=NOKIA7420&Price=8000&Mobil eID=4&TxtQuantity=2&submit=Add+This+Item
Pls sir, get me the solution for this.....
You accidentally sent your reply as a private message instead of putting it in the thread. I am including it here.
Jared
|  | | | Join Date: Jan 2007 Location: logan, utah
Posts: 2,967
| | | re: Microsoft VBScript runtime error '800a01b6'
right before that line, add this to test what you have: - for each x in session("myItems")
-
response.write x.name & ": " & x.value & "<br>" % vbNewLine
-
next
Jared
| | | | Join Date: Nov 2007
Posts: 134
| | | re: Microsoft VBScript runtime error '800a01b6'
The session variable in ASP is not a collection. The .Add() command is probably the problem.
At the same time, though, it depends on the vartype of the session variable. Can you tell me that?
| | | | Join Date: Feb 2010 Location: Coimbatore
Posts: 9
| | | re: Microsoft VBScript runtime error '800a01b6'
The data type of session variable is varient type....
| | | | Join Date: Nov 2007
Posts: 134
| | | re: Microsoft VBScript runtime error '800a01b6'
Variant indicates that the session variable is an array. The Add() will not work, unfortunately.
You have to determine the ubound, and if your new addition would exceed the ubound, you have to redim the array (preserving the contents using keyword 'preserve') to the new ubound (old ubound + 1), then assign the new value to the highest index.
|  | | | | |