vb6 - 我在 vb6 中有运行时错误“3219”,它说我的代码是“在这种情况下不允许操作”,
问题描述
不允许的代码是读取函数“pdffile.read”,我已经尝试获得偏好但不工作
Private Sub Command2_Click()
Set rs = New ADODB.Recordset
rs.Open "select * from tble1", cn, adOpenKeyset, adLockOptimistic
rs.AddNew
If pdfpath <> "" Then
Set pdffile = New ADODB.stream
pdffiletype = adtypebinary
pdffile.Open
pdffile.loadfromfile pdfpath
rs.Fields("pdf") = pdffile.read
rs!pdfid = txt.Text
rs!pdfname = txtname.Text
pdffile.Close
Set pdffile = Nothing
pdffile.Close
Set pdffile = Nothing
End If
rs.Update
rs.Close
Set rs = Nothing
End Sub
解决方案
推荐阅读
- ios - iOS Umbrella Framework - 代码设计问题
- ruby-on-rails - Ransack 和 find_by_sql
- java - 导入 javax.xml.parsers.ParserConfigurationException 无法解析
- javascript - 如何在使用 FileContentResult ActionResult 时了解客户端 ASP.NET MVC 中的文件下载状态?
- haskell - 多态函数的引用透明性
- excel - 如何在 Excel 中查找和替换文本然后保留格式?
- oauth-2.0 - 可以在两个自定义服务之间转发 JWT 吗?
- java - 应用关闭时只运行前台服务以减少内存使用
- c# - Dapper fluent map 不会更改我的专栏名称
- asp.net - Azure 中的 Windows AD 用户模拟