以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  字段插入图片文件报错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=153699)

--  作者:xyazwm
--  发布时间:2020/8/19 22:36:00
--  字段插入图片文件报错
用 sqlinsertfile       在二进制字段中 插入图片文件 时报错,显示 “=附近有语法错误”,该如何处理呢,谢谢!
Dim purl As String=""
Dim weurl As String=""
Dim gdid As String=""
Dim mphone As String=""
Dim i As Integer=1
For Each dr As DataRow In DataTables("chinatea_poi_wechat").DataRows
i=i+1
If i>5
Return
End If
    purl=dr(“purl”)
weurl=dr(“avatar”)
gdid=dr("gdid")
mphone=dr("mphone")
    If len(purl)>20 Or len(weurl)>20
Dim drimage As DataRow
drimage=DataTables("cn_gd_poi_image").addnew()
drimage("gdid")=gdid
drimage("mphone")=mphone
datatables("cn_gd_poi_image").save()
If len(purl)>20
   Dim hc As New HttpClient(purl)
   If hc.GetFile("d:\\chinateacrm\\temp\\shop.jpg") Then
                                 MessageBox.show("shop文件下载成功","提示") 
  Dim filename As String="d:\\chinateacrm\\temp\\shop.jpg"
           drimage.SQLInsertFile("storepic",filename)
                Else
             MessageBox.show("shop文件下载失败","提示")
                End If
End If
If len(weurl)>20
   Dim hc1 As New HttpClient(weurl)
               If hc1.GetFile("d:\\chinateacrm\\temp\\wechat.jpg") Then
                 MessageBox.show("文件下载成功","提示")        
                 drimage.SQLInsertFile("wepic","d:\\chinateacrm\\temp\\shop.jpg")
               Else
                 MessageBox.show("文件下载失败","提示")
               End If
    End If
End If
Next
output.show("end")

--  作者:有点蓝
--  发布时间:2020/8/20 8:59:00
--  
DataTables("cn_gd_poi_image")必须是主表,不能是临时表

出错后看看新增的行是否是已保存状态?

--  作者:xyazwm
--  发布时间:2020/8/20 10:03:00
--  回复:(有点蓝)DataTables("cn_gd_poi_image")必须是...
是远程数据表的主表,是保存状态的,因为还有其他两个字段,都保存了的,就是图片字段不行
--  作者:有点蓝
--  发布时间:2020/8/20 10:05:00
--  
做个例子发上来测试一下