Dim tb As Table = Tables("主窗口_table10")
If tb.Rows.count < 1 Then
Return
End If
Dim tbr As Row = tb.Current
Dim nr As DataRow = tbr.DataRow
Dim nf As String
Dim nf1 As String
Dim drs As List(Of DataRow)
drs = tb.DataTable.S elect("[选中] =true")
If (tb.Current("选中") = True And drs.Count = 1) OrElse drs.Count = 0 Then
drs = tb.DataTable.Select ("id='" & tbr("_Identify") & "'")
End If
Dim dlg As New FolderBrowserDialog
If dlg.ShowDialog = DialogResult.Ok Then
For Each dr As DataRow In drs
If dr.SQLLoadFile("files", dlg.SelectedPath & "\" & dr("文件名").trim() & dr("文件名后缀").trim()) = False Then '如果提取文件失败
Messagebox.Show("附件提取失败,可能并不存在附件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End if
Next
Messagebox.Show(drs.Count & "条 记录下载成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
此主题相关图片如下:微信截图_20240530123441.png
窗口表是副本?还是sqltable?或者fill、DataSource绑定的?SQLLoadFile仅支持主表和副本使用
代码放在什么事件的?
SQLLoadFile仅支持主表和副本使用。另外使用sql取吧:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=154713