一个简单的问题 谢谢您能看完

reddot 2005-08-08 06:50:43
主页是index.asp 调用的页是getdb.asp
调用方法 是这样的(当然里边有写东西是没有用的 )主要是看 getdb.asp

<SCRIPT language=JAVASCRIPT>
function window_onload()
{
var aw = screen.availWidth;
var ah = screen.availHeight;
self.moveTo(0,0);
self.resizeTo(aw, ah);

EtCell1.style.left = 0;
//EtCell1.style.top = 0;
var lWidth = document.body.offsetWidth;
//if( lWidth <= 0) lWidth = 1;
EtCell1.style.width = lWidth-5;


var lHeight = document.body.offsetHeight -EtCell1.style.top-(idTBGeneral.style.top + idTBGeneral.style.height);
if( lHeight <= 0 ) lHeight = 1;
EtCell1.style.height = lHeight-30;

//调用HttpPost()函数和后台程序GetDB.asp交互,取得数据库的一页
strURL = "GetDB.asp?PageNo=1";
strXML= EtCell1.HttpPost(strURL,"");

//把取得数据填入报表式样,以便于产生动态报表
EtCell1.ImportXML(strXML);
}
function OnListChange()
{
//根据用户选择的页吗,从数据库中取得相应的数据,填入报表中
filename = SelectFile.value;
if(filename=="")
return(false);
else
{
//调用HttpPost()函数和后台程序GetDB.asp交互,取得数据库的某一页数据
//其中GetDB.asp是真正从数据库取数的程序
strURL = "GetDB.asp?PageNo=" + filename;
strXML= EtCell1.HttpPost(strURL,"");
EtCell1.OpenDoc(EtCell1.FileName);
EtCell1.ImportXML(strXML);
}

return(true);
}
</SCRIPT>



调用的页是getdb.asp
getdb.asp里有下列文件 主要是"& produce&" 因为 我要用 getdb.asp 连接库

<%
root = server.mappath("/database")
filePath = root + "\Bus.mdb"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath

' 查询数据库
produce=request("produce")
Set Rs =Server.CreateObject("ADODB.Recordset")
strSQL = "select * from "&produce&" where produceid="&request("produceid")
Rs.Open strSQL,Conn,adOpenStatic

-----------------------------------------
问题
-----------------------------------------
我怎么把这些="&request("produceid") "&produce&" 等
写到 getdb.asp 里

以前是这样写的 NotPrint2/MultiRow/GetDB.asp?produceid=153&produce=produce
可是现在我必须 直接访问index.asp页 写index.asp?produceid=153&produce=produce 肯定没有用
...全文
143 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
aspme 2005-08-09
  • 打赏
  • 举报
回复
看楼主的代码的顺序是:连接--查询--选择
对吧?

我想,那就把查询的语句写成一个funtion()
然后每当发生变化的时候就调用一次
reddot 2005-08-09
  • 打赏
  • 举报
回复
晕~~ 现在是开发阶段 给个办法
koala_swnu 2005-08-09
  • 打赏
  • 举报
回复
建议楼主转学ASP.NET
reddot 2005-08-09
  • 打赏
  • 举报
回复
谢 aspme(.net初成型) 但是
引用的方法是类似于 strURL = "GetDB.asp?PageNo=1";
所以 那么写好像不管用
aspme 2005-08-09
  • 打赏
  • 举报
回复
建议把
' 查询数据库
produce=request("produce")
Set Rs =Server.CreateObject("ADODB.Recordset")
strSQL = "select * from "&produce&" where produceid="&request("produceid")
Rs.Open strSQL,Conn,adOpenStatic
写在index.asp里面
reddot 2005-08-09
  • 打赏
  • 举报
回复
上楼 写在那个页面里呢 怎么写
xiaoyao888 2005-08-08
  • 打赏
  • 举报
回复
produce=request("produce")
Set Rs =Server.CreateObject("ADODB.Recordset")
strSQL = "select * from "&produce&" where produceid="&request("produceid")
Rs.Open strSQL,Conn,adOpenStatic
这个不要写在getdb.asp,getdb.asp只写数据库连接即可
打开表的在需要用表的页面再用,这样就不需要提交表名了
peanutsun 2005-08-08
  • 打赏
  • 举报
回复
狂顶
leelong80 2005-08-08
  • 打赏
  • 举报
回复
帮你顶一下,学习!

28,408

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧