以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- '错误信息提示:未将对象引用设置到对象的实例. (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188197) |
-- 作者:sysckj -- 发布时间:2023/9/7 6:53:00 -- '错误信息提示:未将对象引用设置到对象的实例. With wb.AddPanelGroup("page2","pg2","报名选班") wb.AddForm("page2","form1","bmxb.htm") With wb.AddInputGroup("form1","ipg3","选择兴趣班") .Addselect("iname","兴趣班",DataTables("interest_classes").GetComboListString("name")) End With With wb.AddButtonGroup("form1","btg2",False) .Add("btn2", "确定报名", "submit") .add("btn3","取消报名","button").Attribute = "" End With End With Case "bmxb.htm" Dim dr As DataRow =DataTables("users").find("name = \'" & e.cookies(username) & "\'") Dim dr1 As DataRow =DataTables("interest_classes").find("name = \'" & e.PostValues("iname") & "\'") dr("interestid")=dr1("id") dr.Save() e.WriteString("ok") e.WriteString(wb.Build) \'错误信息提示:未将对象引用设置到对象的实例. |
-- 作者:有点蓝 -- 发布时间:2023/9/7 8:59:00 -- http://www.foxtable.com/webhelp/topics/0396.htm,看示例三 |
-- 作者:sysckj -- 发布时间:2023/9/7 12:23:00 -- 我是菜鸟,刚学移动编程,这段代码的问题是我只能得到“INAME”的变量,没有“USERNAME"的变量,调试不出哪里有问题 |
-- 作者:有点蓝 -- 发布时间:2023/9/7 13:28:00 -- 认真理解一下帮助,刚学就更应该看多几遍 示例三 Dim dr As DataRow 如果我们不加上判断,直接: Dim dr As DataRow 一旦订单表并不存在订购数量超过1000的订单,那么Find方法返回Nothing,导致后续代码运行出错。 ------------------------ Dim dr As DataRow =DataTables("users").find("name = \'" & e.cookies(username) & "\'") If dr IsNot Nothing Then \'如果找到的话 |