• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2455
  • Last Modified:

BC30807: 'Let' and 'Set' assignment statements are no longer supported.

Hi I have ajavascript function in asp site which i am trying to use on asp.net page. Basically on asp page .I have a text box and a drop down list on asp form when a value is selected from dropdown the textbox get filled that value. The following javascript function is being called onchange event of the text box. Suppose user changes the values of the item code a javascript error should pop up.

function GetItemName(myitem)
{
var itemCodeArray = new Array()
var itemNameArray = new Array()
var item_code
var varitem_name = "**ERROR**"
var iii
{
if (myCmdty.length = 0) return true;
}
<%  dim i3 %>
<%  i3 = 0 %>
<%  sql = "select item_code, item_name from items where item_code <> 1 and item_code <> 4 and item_code <> 10order by item_code"  %>
<%  set RecordSet=ODBCConnect.Execute (sql)   %>
<%  ' now grab all the records and put it in an array   %>
<%  do while not RecordSet.eof    %>
<%       response.write "itemCodeArray " & "[" & i3 & "]" & "=" & Recordset.fields(0)& ";" %>
<%       response.write "itemNameArray" & "[" & i3 & "]" & "='" & Recordset.fields(1)& "';" %>
<%       i3 = i3 + 1   %>
<%       RecordSet.movenext    %>
<% loop    %>
for (iii = 0; iii <= 40; iii++)
  {
  if (itemNameArray[iii] == myitem)
      {
      varitem_name = itemNameArray [iii]
      break
      }
  }
{
if (varitem_name == "*ERROR*")
      {
       alert("Bad item code entered.");
       return false;
      }
else
      {
      document.My_form.item_name.value = varitem_name;
      return true;
      }
}
}

When I am trying to use this function in asp.net form i get error message BC30807: 'Let' and 'Set' assignment statements are no longer supported.
 How can I modify this function ?
0
PNKJ
Asked:
PNKJ
1 Solution
 
TimCotteeCommented:
Hi PNKJ,

 <%  set RecordSet=ODBCConnect.Execute (sql)   %>

Should be

 <%  RecordSet=ODBCConnect.Execute (sql)   %>


Tim Cottee
0
 
Arthur_WoodCommented:
this block:

<%  dim i3 %>
<%  i3 = 0 %>
<%  sql = "select item_code, item_name from items where item_code <> 1 and item_code <> 4 and item_code <> 10order by item_code"  %>
<%  set RecordSet=ODBCConnect.Execute (sql)   %>
<%  ' now grab all the records and put it in an array   %>
<%  do while not RecordSet.eof    %>
<%      response.write "itemCodeArray " & "[" & i3 & "]" & "=" & Recordset.fields(0)& ";" %>
<%      response.write "itemNameArray" & "[" & i3 & "]" & "='" & Recordset.fields(1)& "';" %>
<%      i3 = i3 + 1   %>
<%      RecordSet.movenext    %>
<% loop    %>


can be greatly simplified(cleaned up) as:

<%  dim i3
        i3 = 0
        sql = "select item_code, item_name from items where item_code <> 1 and item_code <> 4 and item_code <> 10order by item_code"
        RecordSet=ODBCConnect.Execute (sql)
        ' now grab all the records and put it in an array
        do while not RecordSet.eof
           response.write "itemCodeArray " & "[" & i3 & "]" & "=" & Recordset.fields(0)& ";"
           response.write "itemNameArray" & "[" & i3 & "]" & "='" & Recordset.fields(1)& "';"
           i3 = i3 + 1
           RecordSet.movenext  
       loop    %>

AW
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now