在batman基础上改进的,谢谢batman大哥 :-).用的是access2000自带的数据库---nwind.mdb, odbc---NW.
index.html
<HTML>
<HEAD>
<TITLE>RS技术的实现例子</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
td.head {background-color:#3366cc;color:#ffffff}
</style>
</HEAD>
<BODY bgColor=LightGoldenrodYellow>
<script language="JavaScript" src="http://3344net/_ScriptLibrary/rs.htm"></script>
<script language="JavaScript">
RSEnableRemoteScripting("http://3344net/_ScriptLibrary");
</script>
<h1>客户信息</h1>
<hr>
<form name="MyForm">
<p><input type="text" name="state" size="20"> <input type=button value="提 交" name=btnExecute onclick="execAsynch(state.value)"></p>
</form>
<div id=num></div>
<div id=change></div>
<hr>
<SCRIPT LANGUAGE="JScript">
var serverURL = "http://3344net";
var pageURL = "/rs/Data.asp";
function refreshPage(co)
{
if (co.status != 0) {
alert("发生异常错误\n" +
message);
}
strText = co.return_value.split("|");
if (strText == "") {
document.all.change.innerHTML="<table><tr><td class=head>没有找到!!!</td></tr></table>";}
else{
document.all.num.innerHTML="共找到" +strText[0]+ "纪录<br>";
document.all.change.innerHTML="<table border=1 cellpadding=0 cellspacing=0 width=473><tr><td width=197 class=head><p align=center><b>客户</b></td><td width=276 height=24 class=head><p align=center><b>地址</b></td></tr>"+strText[1]+"</table>";
}
}
function execAsynch(state)
{
RSExecute(serverURL+pageURL, "GetEmpInfoAsArray", state, refreshPage);
}
</SCRIPT>
</BODY>
</HTML>
data.asp
<%@ LANGUAGE=VBSCRIPT %>
<% RSDispatch %>
<SCRIPT RUNAT=SERVER Language=javascript>
<!--#INCLUDE VIRTUAL="/_ScriptLibrary/RS.ASP"-->
function Description()
{
this.GetEmpInfoAsArray = DoGetData;
}
public_description = new Description();