%
display=request("display")
GPDM=request("GPDM")
subid=request("subid")
if subid="" then
subid="main"
end if
strToday=cstr(formatdatetime(now,2))
set ado_cs=server.createobject("adodb.connection")
set ADO_CN = Server.CreateObject("ADODB.Connection")
set RS = Server.CreateObject("ADODB.Recordset")
ADO_CN.Open SQL_CNN, SQL_US, SQL_PW
ado_cs.open sql_cs,sql_us,sql_pw
'--定义SQL语句--
flag=0
strGPDM=GPDM
if isnull(strGPDM) or strGPDM="" then
strGPDM="000001"
strGPMC="深发展"
flag=1
end if
SQL = "SELECT gpmc from gszl where gpdm='737"+right(strGPDM,3)+"'" '替换为新股代码
RS.Open SQL, ADO_CN
if rs.EOF=true then '验证新股是否存在
RS.CLOSE
SQL = "SELECT gpmc from gszl where gpdm='"+strGPDM+"'"
RS.Open SQL, ADO_CN
if rs.eof then
RS.CLOSE
SQL = "SELECT name from view_stockdm where code='"+strGPDM+"'"
RS.Open SQL, ADO_CN
if rs.eof then
errstr="该股票("+gpdm+")不存在"
locurl="index.asp"
response.write ""
response.end
else
strGPMC=replace(rs(0)," ","")
rs.close
sql="select gpmc from stockhot where gpdm="&strgpdm&""
rs.open sql,ADO_CN
if rs.eof then
sql="insert into stockhot(gpdm,gpmc) values('"&strgpdm&"','"&strgpmc&"')"
else
sql="update stockhot set views=views+1 where gpdm="&strgpdm&""
end if
rs.close
if subid="main" then
rs.open sql,ADO_CN
end if
end if
else
strGPMC=replace(rs(0)," ","")
if subid="main" then
rs.close
sql="select gpmc from stockhot where gpdm="&strgpdm&""
rs.open sql,ADO_CN
if rs.eof then
sql="insert into stockhot(gpdm,gpmc) values('"&strgpdm&"','"&strgpmc&"')"
else
sql="update stockhot set views=views+1 where gpdm="&strgpdm&""
end if
rs.close
if flag=0 then
rs.open sql,ADO_CN
end if
end if
end if
else
strGPMC=replace(rs(0)," ","")
rs.close
sql="select gpmc from stockhot where gpdm="&strgpdm&""
rs.open sql,ADO_CN
if rs.eof then
sql="insert into stockhot(gpdm,gpmc) values('"&strgpdm&"','"&strgpmc&"')"
else
sql="update stockhot set views=views+1 where gpdm="&strgpdm&""
end if
rs.close
if subid="main" then
rs.open sql,ADO_CN
end if
gpdm="737"+right(GPDM,3)
strgpdm=gpdm
end if
%>