以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- addnew无法保存,什么原因? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=138321) |
-- 作者:ycwk -- 发布时间:2019/7/28 15:24:00 -- addnew无法保存,什么原因? 在命令窗口中测试 ,所有的msgbox都可以正常弹出,并且每次弹出的msgbox("_identify")也在增长,但为什么就是无法保存呢? 百思不得其解 Dim str_accesstoken As String="23_o8m55dxZL_tH2XgBNJ2elFv18BWbZ345ezdl81gZ0gBjodIZ0Dt7wM9-UXMZXoMeMvUIqK9GYU68nUNFk0n-hEFUQVEgWGwdtvgVPWLV14-DyYSNU158uwsM5qqD8JqLo3m77ipctQXRbAHAAHB" Dim hc As new HttpClient("https://api.weixin.qq.com/cgi-bin/user/get?access_token=" & str_accesstoken & "&next_openid=ojT5kwMGMRHO4tJ-nSiKuUzA_Pfk") \'Dim jo As New JObject = JObject.Parse(hc.GetData) Dim jo As JObject = JObject.Parse(hc.GetData) \'msgbox(jo("total")) \'msgbox(jo("count")) \'msgbox(jo("data")("openid").ToString) For Each v As JToken In JArray.Parse(jo("data")("openid").ToString) \' msgbox(v) Dim hc1 As new HttpClient("https://api.weixin.qq.com/cgi-bin/user/info?access_token=" & str_accesstoken & "&openid=" & v.ToString) Dim jo1 As JObject = JObject.Parse(hc1.GetData) \'msgbox(jo1("subscribe")) msgbox(jo1("openid")) \'msgbox(jo1("nickname")) Dim dr As DataRow = DataTables("WeChatUsers").SQLFind("openid=\'" & jo1("openid").ToString & "\'") If dr IsNot Nothing Then \' msgbox(dr("SubscribeTime")) msgbox("有") Else msgbox("无") Dim dr_new As DataRow = DataTables("WeChatUsers").AddNew() msgbox(dr_new("_identify")) dr_new("subscribeState")=jo1("subscribe") dr_new("openid")=jo1("openid") dr_new("nickname")=jo1("nickname") dr_new("sex")=jo1("sex") dr_new("language")=jo1("language") dr_new("city")=jo1("city") dr_new("province")=jo1("province") dr_new("country")=jo1("country") dr_new("headimgurl")=jo1("headimgurl") \' dr_new("SubscribeTime")=CCDate(jo1("subscribe_time").ToString) dr_new("RemarkName")=jo1("remark") dr_new("groupid")=jo1("groupid") \'dr_new.Save DataTables("WeChatUsers").Save msgbox("保存完毕") \'jo1("tagid_list") 这几个值表中没有 \'jo1("subscribe_scene") \'jo1("qr_scene") \'jo1("qr_scene_str") End If Next |
-- 作者:有点蓝 -- 发布时间:2019/7/28 22:44:00 -- 必须使用dr_new.Save SQLFind出来的是独立的行,和任何datatable都没有关系 |
-- 作者:ycwk -- 发布时间:2019/7/29 9:34:00 -- 用 dr_new.save 也保存不了啊,所以我才会用DataTables("WeChatUsers").Save 结果也保存不了,怪了 |
-- 作者:有点蓝 -- 发布时间:2019/7/29 10:30:00 -- dr_new("groupid")=jo1("groupid") msgbox(111) ‘这里能不能弹出 dr_new.Save
|