服装品牌分析ppt:ASP生成静态,调用不到网页ID!

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 21:54:01
请助,我下面这段代码生成静态页以后只能生成数据库里的第一个数据页。比如Prog_ID字段第一个是1,就只能生成1.html 我用htm.asp?id=4912也生成不了4912.html 生成出来的还是1.html是不是我的查询语句错了,那位高手帮帮,新手在线等,解决了送出XB
有朋友告诉我要加循环
do while not rsData.eof
......
loop
可我加在那也不行。不是循环到ASP超时就是错误。。

<----htm.asp-->
<%
szSQL = "SELECT Prog_ID FROM proginfo"
rsData.Open szSQL,con,1,3
if not rsData.eof then

Function GetPage(url)
dim Retrieval
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False '', "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function

Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
on error resume next
Url="http://*****/show.asp?id="&rsData("Prog_ID")&""
''response.write "开始更新页面..."
wstr = GetPage(Url)

Set fs=Server.CreateObject("Scripting.FileSystemObject")

If (fs.FileExists(server.MapPath("../../html/")&"\"&rsData("Prog_ID")&".htm")) Then
fs.DeleteFile(server.MapPath("../../html/")&"\"&rsData("Prog_ID")&".htm")
End If

Set CrFi=fs.CreateTextFile(server.MapPath("../../html/")&"\"&rsData("Prog_ID")&".htm")
Crfi.Writeline(wstr)
set CrFi=nothing
set fs=nothing
response.write "...<font color=red>更新完成!</font>"

rsData.Close
end if
%>

可能是只读了第一条记录吧!!--指针下移