-- 作者:cnsjroom
-- 发布时间:2022/5/25 12:57:00
-- 升级到20220524版本 二进制文件下载出错……提示where子句语法错误?附件提取失败,可能并不存在附件!",
升级到20220524版本 二进制文件下载出错……
代码如下:【可以弹出1.2不能弹出3,提示where子句语法错误?附件提取失败,可能并不存在附件!", 】
Dim zs1 As Integer = Tables(e.form.name & "_table2").Count
If zs1 >0 Then Dim wb As WinForm.WebBrowser = e.Form.Controls("WebBrowser1") Dim tb As WinForm.TabControl = e.Form.Controls("TabControl2") Dim pc As WinForm.PictureBox = e.Form.Controls("PictureBox1") e.Form.Controls("WebBrowser1").OfficeToolBar = True Dim lst As List(of String) lst = Tables(e.form.name & "_table2").Current.DataRow.Lines("文件名") \'msgbox("第一个文件为:" & lst(0)) vars("文件名")=lst(0) Dim dr As DataRow = Tables(e.form.name & "_table2").Current.DataRow Dim fl As String = ProjectPath & "下载文件\\" & lst(0) & "." & dr("文件类型") MessageBox.Show(1) If Tables(e.form.name & "_table2").Current Is Nothing Then wb.Address=Nothing pc.Image = GetImage(Nothing) Return End If MessageBox.Show(2) If FileSys.FileExists(fl) AndAlso CRCCheckFile(fl) = dr.SQLGetValue("CRC值") Then \'如果本地存在同名文件且CRC校验值相同 \'则直接使用本地文件 Else \'否则从数据库提取文件 If dr.SQLLoadFile("附件",fl) = False Then \'如果提取文件失败 Messagebox.Show("附件提取失败,可能并不存在附件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information) Return End If End If MessageBox.Show(3) vars("文件")=fl Dim bbb As String =dr("文件类型") If bbb.Contains("bmp") Or bbb.Contains("jpg") Or bbb.Contains("gif") Or bbb.Contains("png") Then wb.Address = Nothing pc.Image = GetImage(fl) tb.SelectedIndex=1 Else If bbb.Contains("xls") Or bbb.Contains("xlsx") Or bbb.Contains("doc") Or bbb.Contains("docx") Or bbb.Contains("txt") Or bbb.Contains("pdf") Then wb.Address = fl pc.Image = GetImage(Nothing) tb.SelectedIndex=0 Dim dk As WinForm.Button = e.Form.Controls("打开word") dk.PerformClick Else If bbb.Contains("mp3") Or bbb.Contains("mp4") Or bbb.Contains("wav") Then Dim bf As WinForm.Button = e.Form.Controls("播放视频") bf.PerformClick Else If bbb=Nothing Then wb.Address=Nothing End If End If
|