以下是引用有点蓝在2018/9/10 23:12:00的发言:
使用sqlcommand,有返回值就是空的
select 1 from 表A where
photo is null and 编号='xxx'
''照片提取
Dim dr As DataRow = Tables("person").Current.DataRow
Dim fl As String = " ApplicationPath " & dr("_Identify") & ".JPG" ''相对路径
'Dim fl As String = "C:\Users\sujia\Documents\Foxtable项目\retireMg\Images\" & dr("_Identify") & ".JPG"
If dr.SQLLoadFile("photo",fl) Then '如果提取文件成功
Dim Proc As New Process '打开文件
Proc.File = fl
''照片存入
If Tables("history").Current Is Nothing Then
Return
End If
Dim dr3 As DataRow = Tables("history").Current.DataRow
dr3.SQLInsertFile("photo",fl) '插入文件
Dim pic As WinForm.PictureBox = e.Form.Controls("PictureBox1")
pic.Image = GetImage(fl)
'Proc.Start()
Else
Messagebox.Show("照片提取失败,可能并不存在附件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
可以用这个办法判断照片是否存在么,它和sqlcommend有啥区别