asp代码替换

来源:百度知道 编辑:UC知道 时间:2024/06/19 00:18:45
dim datafrom'数据表名
datafrom="ameav_pl"
dim datawhere'数据条件
if Result="Search" then
datawhere="where ( nick like '%" & Keyword &_
"%') and addtime >= #" & StartDate & " # and addtime <= #" & EndDate & "#"
else
datawhere=""
end if
dim sqlid'本页需要用到的id
dim Myself,PATH_INFO,QUERY_STRING'本页地址和参数
PATH_INFO = request.servervariables("PATH_INFO")
QUERY_STRING = request.ServerVariables("QUERY_STRING")'
if QUERY_STRING = "" or Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")=0 then
Myself = PATH_INFO & "?"
else
Myself = Left(PATH_INFO & "?" & QUERY_STRING,Instr(PATH_INFO & "?" & QUERY_STRING,"Page=")-1)
end if
dim taxis'排序的语句 asc,desc

我想把这个“pid”换成同一数据库的另一数据表:“ameav_pl”里的“ProductName” 描述有误
既然是另一数据表,那为什么数据表名还是“ameav_pl”

如果是同一张表的不同字段,则可以直接把rs("pid")改为rs("ProductName")
如果不是同一张表,假设另一数据表名为Product,则可以直接把rs("pid")改为Conn.Execute("Select ProductName From Product Where 两表之间的联系条件")(0)