<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request.Form ("Hosttype")=""  or Instr(Request.Form ("Hosttype"), "'")>1  Then
	ef=True
	ec="原来的产品名没填！"
ElseIf Request.Form ("newHosttype")=""  or Instr(Request.Form ("newHosttype"), "'")>1  Then
	ef=True
	ec="新的产品名没填！"
elseIf session("cansetpro")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_IDCProductlist where IDCtype='"&Request.Form ("Hosttype")&"'"
		ds.Open Sql,conn,1,3
if  ds.Eof then
	ef=True
	ec="没找到要修改的产品！"
end if
end if

if not ef then%>
<%
'	Set ds = Server.CreateObject("ADODB.Recordset")	
'		Sql="Select * from FreeHost.FreeHost_HostProductlist_AGN where id='"&id&"'"
'		ds.Open Sql,conn,1,3
'while not  ds.Eof
'ds("Hosttype")=trim(Request.Form("newHosttype"))
'id=ds("id")
'ds.Update
'ds.movenext
'wend

Set dsph = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Product_IDC"
	dsph.Open Sql,conn,1,3
while not dsph.Eof
if dsph("IDCtype")=ds("IDCtype") then dsph("IDCtype")=Trim(Request.Form ("newHosttype"))
dsph.update
dsph.movenext
wend
dsph.close

ds("IDCtype")=trim(Request.Form("newHosttype"))
id=ds("id")
ds.Update
ds.Close

set ds=nothing
conn.Close 
set conn=nothing
Response.Redirect "product-idc.asp"
%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>