recordset.Open sSQL,connection,1,1

解决方案 »

  1.   

    改过了,没作用啊,我想是不是在我插入<%=recordset("ID")%>到对应单元格后,字符<%=recordset("ID")%>已经变了,能帮我调试一下吗?谢谢
      

  2.   

    Set rs = Server.CreateObject("ADODB.Recordset")
    response.write rs("ID") &""试试这样行不行
      

  3.   

    因为需要用户自己定义<%=recordset("ID")%>在表格中位置,没办法用直截用response.write 输出,否则也不用这么麻烦了
      

  4.   

    <%'---------------%>
    <% @ Language="VBScript" %>
    <% Option Explicitdim connection,recordset
    dim sSQL,sConnStringsSQL="SELECT * FROM tblFriends"if  request.form("type") = "ok" then
    sConnString="DRIVER={Microsoft Access Driver (*.mdb)};" & _
    "DBQ=" & Server.MapPath("WebDB.mdb") & ";"Set connection = Server.CreateObject("ADODB.Connection")
    Set recordset = Server.CreateObject("ADODB.Recordset")recordset.Open sSQL,connection,1,3end if %>
    <%'---------------%>
    <BODY>
    <div id=Layer1 
         style="border:1px solid; Z-INDEX: 1; VISIBILITY: hidden; POSITION: absolute; BACKGROUND-COLOR: #eeeeee"
     >
    &nbsp;
    <Select id=s1><Option value = "<%=recordset("ID")%>">aa</Option></Select> 
    <INPUT type="button" value="确定"  onclick="eee();" style="border:1px solid; HEIGHT: 20px">
    &nbsp;
    </div><form action = "test.html" method="post" name=form1>
    <TABLE 
    WIDTH=200 border="1" cellpadding="0" cellspacing="0"  bordercolor="#eeeeee"  onclick="aaa();"  onmouseover="bbb();" onmouseout="ccc();">
      <TR>
    <TD >11</TD>
    <TD >12</TD>
    </TR>
    <TR>
    <TD >21</TD>
    <TD >22</TD>
    </TR>
        <TR>
    <TD><INPUT TYPE="submit"  name = "type" value="ok"></TD>
    </TR>

    </TABLE></form><SCRIPT >
    var obj;
      function aaa()
    {
    obj=window.event.srcElement;
    Layer1.style.visibility="visible";
    Layer1.style.top=window.event.srcElement.offsetTop + 40;
    Layer1.style.left=window.event.srcElement.offsetLeft+10;
    }
    function bbb()

    window.event.srcElement.borderColor="#FF0000";
    }
    function ccc()
    {
    window.event.srcElement.borderColor="#eeeeee";

    }
    function eee()
    {
    if(obj=="[object]")
    {
    obj.innerText=s1.value;
    Layer1.style.visibility="hidden";
    }
    }
    </SCRIPT>
    <%
    if request.form("type") = "ok" thenRecordset.Close
    Connection.Close
    Set Recordset = Nothing
    Set Connection = Nothingend if
    %></BODY>
    </HTML>
      

  5.   

    to:Amely(我爱我老婆!) 调试了,还是告诉我:
    HTTP 错误 405
    405 不允许此方法
    对于请求所标识的资源,不允许使用请求行中所指定的方法。请确保为所请求的资源设置了正确的 MIME 类型。
    如果问题依然存在,请与服务器的管理员联系。你运行有问题吗?谢谢
      

  6.   

    问题可能不是recordset.Open sSQL,connection的参数...
      

  7.   

    高手来也,
    出现500错误一定是程序出错了,想不想知道是多少行错了?IE工具条  工具-->Internet选项-->高级  把"显示友好http错误信息"前面的挑去掉    就ok了看什么看,
    给分吧