日期:2014-05-17  浏览次数:20704 次

没接触过asp啊 菜鸟问题! 这句代码怎么修改
Response.Redirect("Diagramtext.Asp?typeId=11&Page=" & Request.Form("PageKey"))

这条代码中 typeId=11如果要把11换成数据库里的某个字段 怎么写 
就是typeId不要固定的 比如数据库里有个cTypeId字段 我要这个typeId不等于固定值11而等于 cTypeId 这个字段 
没接触过asp啊 菜鸟问题!

------解决方案--------------------
Set conn = CreateObject("ADODB.Connection")
conn.Open "xxxxx"
s = ""
sql = "SELECT xxxx FROM tbl WHERE id=xxx"
Set rs = CreateObject("ADODB.RecordSet")
rs.CursorLocation = 3
rs.Open sql, conn, 1, 1
If Not (rs.EOF And rs.BOF) Then
s = rs("xxxx").Value
End If
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing

Response.Redirect "Diagramtext.Asp?typeId=" & Server.URLEncode(s) & "&Page=" & Server.URLEncode(Request.Form("PageKey"))