/beta/inventory/xml_MaxID4newItems.asp

http://github.com/khaneh/Orders · ASP · 26 lines · 21 code · 4 blank · 1 comment · 5 complexity · 62dcceefde950fbc23c47eeb92b51656 MD5 · raw file

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1256"%>
  2. <!--#include file="../config.asp" -->
  3. <%
  4. if request("id")="" then
  5. response.write escape ("ÎÇáí ÇÓÊ " )
  6. response.end
  7. end if
  8. if not isnumeric(request("id")) then
  9. response.write escape ("ÎØÇ! " )
  10. response.end
  11. end if
  12. sql="SELECT MAX(dbo.InventoryItems.OldItemID) + 1 AS maxID FROM dbo.InventoryItems INNER JOIN dbo.InventoryItemCategoryRelations ON dbo.InventoryItems.ID = dbo.InventoryItemCategoryRelations.Item_ID GROUP BY dbo.InventoryItemCategoryRelations.Cat_ID HAVING (dbo.InventoryItemCategoryRelations.Cat_ID = "& request("id") & ")"
  13. 'response.write sql
  14. set rs=Conn.Execute(sql)
  15. if (rs.EOF) then
  16. response.write escape ("")
  17. else
  18. response.write escape( rs("maxID") )
  19. end if
  20. rs.close()
  21. conn.close()
  22. %>