我有一个加密数据库,使用“SQLite 密码”。当我尝试使用连接字符串连接到数据库时,出现以下错误消息:
“SQL 逻辑错误无法使用“密码”连接字符串属性:库未构建加密支持。”
Imports System.Data.SQLite
Public Class frm_projects
Dim dtset As New SQLiteConnection("Data Source=Setting.db;Password=m;")
Private Sub frm_projects_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
If dtset.State = ConnectionState.Closed Then
dtset.Open()
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "Warning")
End Try
End Sub
End Class
图像来自数据库浏览器 sqlite 密码
问题来源
我认为此错误的实际原因是缺乏“legacy CryptoAPI”的支持,因为System.Data.SQLite
版本~1.0.113.1.
这是在以下提交中完成的:https://system.data.sqlite.org/index.html/info/1dd56c9fd59a10fd
我们可以做什么?
-
Manually使用具有 CryptoAPI 支持的最新 NuGet 版本 -1.0.112.2.
Notice - It must be done manually - either by editing PackageReference
in csproj
or by editing config.packages
.
the reason is that older versions are unlisted (!) from the NuGet feed:
-
购买永久源代码许可证SQLite Encryption Extension
(SEE
)一次性费用为 2000 美元(截至 2021 年 2 月)-购买链接
-
Use SQLCipher
- SQLCipher 是一个 SQLite 扩展,提供数据库文件的 256 位 AES 加密 -GitHub 源码(我自己没有测试过!)
数据源
- https://system.data.sqlite.org/index.html/tktview?name=9c330a3e03
- https://stackoverflow.com/a/64392325/426315
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)