一般用服务端脚本
或者rds
没有纯Javascript的

解决方案 »

  1.   

    Remote Data Service (RDS)
    The Remote Data Service  is a more sophisticated DSO that ships with Internet Explorer 4.0. RDS obtains its data from a database using OLE-DB or ODBC. Consider using RDS if: You have existing data in an OLE-DB or ODBC-compliant database management system (DBMS) such as SQL Server, Microsoft® Access, or Oracle. 
    You want to specify the data using an SQL statement. 
    You need to provide update, insert, and delete capabilities. 
    You want direct, real-time access to the data. 
    A declaration specific to RDS is as follows: <OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33"
        ID=dsoComposer HEIGHT=0 WIDTH=0>
        <PARAM NAME="Server"  VALUE="http://musicserver">
        <PARAM NAME="Connect" VALUE="dsn=music;uid=guest;pwd=">
        <PARAM NAME="SQL"     VALUE="select compsr_name from composer">
    </OBJECT>First, note the class identifier (CLSID) specific to RDS. Every ActiveX component requires a CLSID to differentiate it from other objects registered on the system. Next, note that the base properties exposed by RDS differ significantly from those exposed by the TDC. That's because the TDC derives its data from a flat text file, while the RDS is capable of retrieving and updating data from any OLE-DB or ODBC-compliant database. The following are the properties specified in the example declaration above.Server String identifying the protocol and the server that supplies the data. 
    Connect Standard ODBC connection string identifying the data source name configured on the server. 
    SQL SQL query identifying the table and columns to be selected from the database. For the specifics on how to use RDS, see the RDS Documentation . 
      

  2.   

    可以用javascript写服务器端脚本
    1.在ASP中可以通过javascript打开一个ADO对象来读取数据记录;也可以在浏览器打开一个ADO对象访问远程数据库
    2.如果使用JSP,JRun和Resin都支持在服务器端编译运行javascript,这个是通过使用java.sql包里面的Connection、RecordSet来访问数据库更详细的部分,还得阁下亲躬才行呀
      

  3.   

    这是个用ASP+JSCRIPT的例子,当然,如果你想在客户端用的话,只要客户端ACTIVEX安全设置足够低,而且相应的数据库又让你使用的话,应该没问题,只要把RUNAT="Server"去掉,把Response换成document即成<%@ language=JScript %>
    <HTML>
    <BODY>
    <TITLE>ASP+JSCRIPT</TITLE>
    <SCRIPT LANGUAGE="JSCRIPT" RUNAT="Server">
    Response.write('<TABLE border="1" cellspacing="0" cellpadding="0">');
    var sSQL = 'SELECT * FROM authors';
    var oConn= new ActiveXObject("ADODB.Connection");
    oConn.Open('Provider=SQLOLEDB;Server=(local);Database=pubs;UID=sa;PWD=;');
    var rs = oConn.Execute(sSQL);  
    var i;
    Response.write('<tr>');
    for (i = 0; i < rs.Fields.Count - 1; i++)
    {
     Response.write('<td>' + rs(i).Name + '</td>');
    }
    Response.write('</tr>');while (!rs.EOF)
    {
      Response.write('<tr>');  
      for (i = 0; i < rs.Fields.Count - 1; i++)
      {
        Response.write('<td>' + rs(i).Value + '</td>'); 
      }
      Response.write('</tr>');
      rs.MoveNext();
    }
    rs.Close();
    oConn.Close();
    rs=null;
    oConn = null;
    Response.write('</TABLE>');
    </SCRIPT>
    </BODY>
    </HTML>
      

  4.   

    利用javascript操作ACTIVEX组件,ADO或RDS,读取。
      

  5.   

    我觉得用ASP+javascrip很不错,我有点不明白,这么简单就可以实现的功能,你就不能用ASP写吗?非要全用Javascrip?
      

  6.   

    动态页面ASP,用javascript作脚本
    静态页面不可能实现