注册 登录
编程论坛 ASP技术论坛

设置好数据不能保存,请给看一下

jingjing316 发布于 2010-10-21 15:36, 593 次点击
只有本站会员才能查看附件,请 登录

设置了题量和分值后,点击修改,不出现相应的分数,而是值零
个人感觉是这段语句中有错误,可是又不知道是错在哪里
 sqlti1="select * from  tbtk   where kao=1 and kcid="&kcid&" and category="&rschap("category")&" and chapter>="&rs1("schap")&" and  chapter<="&rs1("echap")&" and level >="&rschap("slevel")&" and  level <="&rschap("elevel")&""
          'response.write sqlti1&"]"
            set rsti1=server.createobject("adodb.recordset")
            rsti1.open sqlti1,conn,3,2
            
           if rsti1.eof then
                response.write "0"  
            else
                response.write rsti1.recordcount
            end if %>
附上此文件的全部代码
只有本站会员才能查看附件,请 登录
5 回复
#2
gupiao1752010-10-21 15:55
sqlti1="select * from  tbtk   where kao=1 and kcid="&kcid&" and category="&rschap("category")&" and chapter>="&rs1("schap")&" and  chapter<="&rs1("echap")&" and level >="&rschap("slevel")&" and  level <="&rschap("elevel")&""
          'response.write sqlti1&"]"
            set rsti1=server.createobject("adodb.recordset")
            rsti1.open sqlti1,conn,3,2
            
           if rsti1.eof then
                response.write "0"  
            else
                response.write rsti1.recordcount
            end if %>
你是要更新吗,上面的语句既没有更新又没有插入类的语句,是何意思呢?
#3
jingjing3162010-10-21 16:25
失误失误
上面这段是统计已有类型题量的
只有本站会员才能查看附件,请 登录


[ 本帖最后由 jingjing316 于 2010-10-21 16:27 编辑 ]
#4
jingjing3162010-10-21 16:29
if Request.ServerVariables("http_method")="POST" then
   sqlmc2="SELECT * FROM  tbkcconfig where kcid="&kcid&" and  category="&rschap("category")&" and paperno="&rschap("paperno")
   set rsmc2=server.createobject("adodb.recordset")
   rsmc2.open sqlmc2,conn,3,2
  textmc2=request(""&textmc1&"")
   textmc4=request(""&textmc3&"")
   rsmc2("datavalue")=textmc4 '这个地方没有起作用
   rsmc2("datano")=textmc2     ' 这个地方没有起作用
   rsmc2.update
在数据库表中数据为0,而不是我设置的数据
  

[ 本帖最后由 jingjing316 于 2010-10-21 16:34 编辑 ]
#5
gupiao1752010-10-21 18:17
以下是引用jingjing316在2010-10-21 16:29:04的发言:

if Request.ServerVariables("http_method")="POST" then
   sqlmc2="SELECT * FROM  tbkcconfig where kcid="&kcid&" and  category="&rschap("category")&" and paperno="&rschap("paperno")
   set rsmc2=server.createobject("adodb.recordset")
   rsmc2.open sqlmc2,conn,3,2
  textmc2=request(""&textmc1&"")
   textmc4=request(""&textmc3&"")
   rsmc2("datavalue")=textmc4 '这个地方没有起作用
   rsmc2("datano")=textmc2     ' 这个地方没有起作用
   rsmc2.update
在数据库表中数据为0,而不是我设置的数据
  
为何不起作用呢?
难道也没有错误提示吗?
如果还不行,更换一种方式sql="update tbkcconfig set datavalue='"&textmc4&"',datano='"&textmc2&"' where kcid="&kcid
conn.execute sql
#6
jingjing3162010-10-22 16:53
谢谢,问题已经解决
1