homeshopper
asked on
'error '800a000d' Type mismatch line 348
I am getting 'error '800a000d' Type mismatch line 348.
RowCount = Session("strRowCount")
myArray = Session("sessionmyArray")' error '800a000d' Type mismatch line 348
myArray(RowCount) = CString
For clarity the full code is below:
Thanks in advance for any help given.
<%
Sub BindData3()
currentPage = Request.QueryString("PageI D")
if currentPage = 0 then
Response.Write("<div style='position:absolute;w idth:837px ;height:36 6px;left:0 px;top:260 px;font-si ze:xx-smal l;overflow :auto;bord er:1px solid #722F90;' id='DIV999'>")
Response.Write("header2:" & currentPage & "#BindData3():<br/>")
Dim strRowArray2(20, 1)
Dim strRow
Dim strColumn
Dim RowCount
Dim ColumnCount
strColumn = 1
CString = Session("sessionCString")
TableLabel = Session("sessionTableLabel ")
RowCount = Session("strRowCount")
'************************* ********** *****
%>
<%
if RowCount = "" then
RowCount = 0
End if
Dim myArray()
ReDim Preserve myArray(RowCount) 'Re-Declaring a dynamic array
Session("sessionmyArray") = myArray
Response.Write("RowCount:" & RowCount & "#")
Response.Write ("Total element of the array = " & UBound(myArray) )
if RowCount = 0 then
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
Dim strRowArray
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
Dim oCounter : oCounter = 0
If IsArray(strRowArray) Then
Dim strCountRow, strCountCol
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
else
RowCount = Session("strRowCount")
myArray = Session("sessionmyArray")' error '800a000d' Type mismatch line 348
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
oCounter = 0
If IsArray(strRowArray) Then
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
end if
%>
<%
'************************* ********** *****
RowCount = RowCount + 1
Session("strRowCount") = RowCount
Response.Write("</div>")
end if
End Sub
%>
<%
Select Case Request.Form("strButtonAct ion")
Case "B1"
BindData1()
Case "B2"
BindData2()
Case "B3"
BindData3()
Case "B4"
BindData4()
Case "B5"
BindData5()
Case tempDefault
txtProvider = Session("xtProvider")= "<font color='red'>NOT LOGGED IN!!</font>"
End Select
%>
RowCount = Session("strRowCount")
myArray = Session("sessionmyArray")'
myArray(RowCount) = CString
For clarity the full code is below:
Thanks in advance for any help given.
<%
Sub BindData3()
currentPage = Request.QueryString("PageI
if currentPage = 0 then
Response.Write("<div style='position:absolute;w
Response.Write("header2:" & currentPage & "#BindData3():<br/>")
Dim strRowArray2(20, 1)
Dim strRow
Dim strColumn
Dim RowCount
Dim ColumnCount
strColumn = 1
CString = Session("sessionCString")
TableLabel = Session("sessionTableLabel
RowCount = Session("strRowCount")
'*************************
%>
<%
if RowCount = "" then
RowCount = 0
End if
Dim myArray()
ReDim Preserve myArray(RowCount) 'Re-Declaring a dynamic array
Session("sessionmyArray") = myArray
Response.Write("RowCount:"
Response.Write ("Total element of the array = " & UBound(myArray) )
if RowCount = 0 then
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
Dim strRowArray
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
Dim oCounter : oCounter = 0
If IsArray(strRowArray) Then
Dim strCountRow, strCountCol
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
else
RowCount = Session("strRowCount")
myArray = Session("sessionmyArray")'
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
oCounter = 0
If IsArray(strRowArray) Then
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
end if
%>
<%
'*************************
RowCount = RowCount + 1
Session("strRowCount") = RowCount
Response.Write("</div>")
end if
End Sub
%>
<%
Select Case Request.Form("strButtonAct
Case "B1"
BindData1()
Case "B2"
BindData2()
Case "B3"
BindData3()
Case "B4"
BindData4()
Case "B5"
BindData5()
Case tempDefault
txtProvider = Session("xtProvider")= "<font color='red'>NOT LOGGED IN!!</font>"
End Select
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi robert_schutt,
Thank you for your help. I used your suggested code and it now clears the error.
I have just one further query. The array is incremented and displays the last data row.
That is fine, but previous row elements are lost. It is not preserving the complete data records entered. Thanks in advance for any help given.
Thank you for your help. I used your suggested code and it now clears the error.
I have just one further query. The array is incremented and displays the last data row.
That is fine, but previous row elements are lost. It is not preserving the complete data records entered. Thanks in advance for any help given.
Well, it seems to me that in this part of the code:
Dim myArray()
ReDim Preserve myArray(RowCount) 'Re-Declaring a dynamic array
Session("sessionmyArray") = myArray
you actually empty out the array in the Session. Have a good look at what you want to do, maybe that part can be skipped altogether?
ASKER
I had not neglected the question, but have been away.
I have now got it all working, so will award the points.
The complete solution is below for others to see.
Thankyou for the help.
<%
Sub BindData3()
currentPage = Request.QueryString("PageI D")
if currentPage = 0 then
Response.Write("<div style='position:absolute;w idth:837px ;height:35 4px;left:0 px;top:270 px;font-si ze:xx-smal l;overflow :auto;bord er:1px solid #722F90;' id='DIV999'>")
Response.Write("header2:" & currentPage & "#BindData3():<br/>")
Dim strRowArray2(20, 1)
Dim strRow
Dim strColumn
Dim RowCount
Dim ColumnCount
strColumn = 1
CString = Session("sessionCString")
TableLabel = Session("sessionTableLabel ")
RowCount = Session("strRowCount")
'************************* ********** *****
%>
<%
if RowCount = "" then
RowCount = 0
End if
Dim myArray()
ReDim Preserve myArray(RowCount) 'Re-Declaring a dynamic array
'Session("sessionmyArray") = myArray
Response.Write("RowCount:" & RowCount & "#")
'Response.Write ("Total element of the array = " & UBound(myArray) )
if RowCount = 0 then
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
Dim strRowArray
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
Dim oCounter : oCounter = 0
If IsArray(strRowArray) Then
Dim strCountRow, strCountCol
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
else
RowCount = Session("strRowCount")
Dim myArrayTEMP
myArrayTEMP = Session("sessionmyArray")' error '800a000d' Type mismatch line 348
ReDim Preserve myArrayTEMP(RowCount) 'Re-Declaring a dynamic array
myArrayTEMP(RowCount) = CString
for i=0 to uBound(myArrayTEMP)
Response.Write "<br>(" & i & ")" & myArrayTEMP(i) & "#"
Next
Session("sessionmyArray") = myArrayTEMP
response.write "<br/>array assigned to session var..."
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
oCounter = 0
If IsArray(strRowArray) Then
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
end if
%>
<%
'************************* ********** *****
RowCount = RowCount + 1
Session("strRowCount") = RowCount
Response.Write("</div>")
end if
End Sub
%>
I have now got it all working, so will award the points.
The complete solution is below for others to see.
Thankyou for the help.
<%
Sub BindData3()
currentPage = Request.QueryString("PageI
if currentPage = 0 then
Response.Write("<div style='position:absolute;w
Response.Write("header2:" & currentPage & "#BindData3():<br/>")
Dim strRowArray2(20, 1)
Dim strRow
Dim strColumn
Dim RowCount
Dim ColumnCount
strColumn = 1
CString = Session("sessionCString")
TableLabel = Session("sessionTableLabel
RowCount = Session("strRowCount")
'*************************
%>
<%
if RowCount = "" then
RowCount = 0
End if
Dim myArray()
ReDim Preserve myArray(RowCount) 'Re-Declaring a dynamic array
'Session("sessionmyArray")
Response.Write("RowCount:"
'Response.Write ("Total element of the array = " & UBound(myArray) )
if RowCount = 0 then
myArray(RowCount) = CString
for i=0 to uBound(myArray)
Response.Write "<br>(" & i & ")" & myArray(i) & "#"
Next
Session("sessionmyArray") = myArray
response.write "<br/>array assigned to session var..."
Dim strRowArray
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
Dim oCounter : oCounter = 0
If IsArray(strRowArray) Then
Dim strCountRow, strCountCol
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
else
RowCount = Session("strRowCount")
Dim myArrayTEMP
myArrayTEMP = Session("sessionmyArray")'
ReDim Preserve myArrayTEMP(RowCount) 'Re-Declaring a dynamic array
myArrayTEMP(RowCount) = CString
for i=0 to uBound(myArrayTEMP)
Response.Write "<br>(" & i & ")" & myArrayTEMP(i) & "#"
Next
Session("sessionmyArray") = myArrayTEMP
response.write "<br/>array assigned to session var..."
strRowArray = Session("sessionmyArray") ' strRowArray(i, j)
oCounter = 0
If IsArray(strRowArray) Then
strCountRow = UBound(strRowArray, 1)
'strCountCol = UBound(strRowArray, 2) ' or the other way around...
response.write "<br/>array dimensions: " & strCountRow & " x " & strCountCol
Else
response.write "<br/>no array"
End If
end if
%>
<%
'*************************
RowCount = RowCount + 1
Session("strRowCount") = RowCount
Response.Write("</div>")
end if
End Sub
%>
<%
Dim myDynArray() 'Dynamic size array
ReDim myDynArray(1)
myDynArray(0) = "Albert Einstein"
myDynArray(1) = "Mother Teresa"
ReDim Preserve myDynArray(3)
myDynArray(2) = "Bill Gates"
myDynArray(3) = "Martin Luther King Jr."
For Each item In myDynArray
Response.Write(item & "<br />")
Next
%>