且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从数据库中删除时,SQL 逻辑错误或缺少数据库没有这样的表

更新时间:2023-02-02 21:53:26

不确定这是否对您有帮助,但我遇到了类似的问题:'没有这样的表:***'

Not sure if this will help you, but I ran into a similar problem: 'no such table: ***'

就我而言,事实证明我的连接字符串会将数据库指定为相对路径:

In my case it turned out to be the fact that my connection string would specify database as a relative path:

'URI=file: mydatabase.sqlite'

一切正常,直到我在我的应用程序中使用OpenFileDialog".这会更改当前目录,并抛出连接字符串.一个快速修复,是在连接字符串中使用数据库的绝对路径:

It all worked fine, until I would use an 'OpenFileDialog' inside my application. That changes current directory, and throws off the connection string. A quick fix, is using absolute path for your database inside the connection string:

'URI=file: C:\Test\mydatabase.sqlite'