- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我使用 Zeoslib 组件与我的 SQLite 数据库文件进行交互。我在一个文件夹中有几个 SQLite 数据库文件。所以,我希望能够使用 Zeoslib 组件打开其中任何一个。但是,它不会让我。它成功打开了第一个数据库,但之后我打开的任何数据库文件都会出现访问冲突错误。对于我的生活,我根本无法弄清楚为什么。
这是我打开数据库文件的方式。
procedure TMainFrm.Open1Click(Sender: TObject);
var currdb:string;
begin
OpenDlg.InitialDir := BaseDir;
if OpenDlg.Execute = true then
begin
currdb := Extractfilename(OpenDlg.FileName);
DataModule1.ZConnection1.Disconnect;
DataModule1.ZConnection1.Protocol := 'SQLite-3';
DataModule1.ZConnection1.Database :=baseDir + currdb;
DataModule1.Query1.SQL.Clear;
DataModule1.Query1.SQL.Add('SELECT * FROM MyTable'); // <<<<--- ZConnection1 is Query1 database connection.
DataModule1.ZConnection1.Connect; // <<<<<-------Here is where I get ACCESS VIOLATION all the time.
UpdateGrid; // <<<<<<<----- Here is where the Query is executed and the DBGrid is updated.
end;
end;
我不知道这是为什么。这是否意味着我无法使用 Zeoslib 组件从另一个数据库切换数据库?
最佳答案
问题出在 TZConnection.Protocol
值大写中。将 Protocol
值从 SQLite-3
更改为 sqlite-3
.
关于database - Zeoslib 不允许切换数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26890563/
我使用 Zeoslib 组件与我的 SQLite 数据库文件进行交互。我在一个文件夹中有几个 SQLite 数据库文件。所以,我希望能够使用 Zeoslib 组件打开其中任何一个。但是,它不会让我。它
是否可以使用 Zeoslib 和 Firebird 确定参数化查询中的参数数据类型? 我正在从 FibPlus 迁移到 Zeoslib。 带有类似“从注册成员(member)中选择名字、姓氏、年龄
我正在使用 mysql 开发一个项目,为此我正在使用 zeoslib 做一个类,我可以建立连接,我可以执行插入、更新等查询。但我的问题是 select,我运行它悄悄地,但我该怎么做才能得到返回呢?我想
我想知道如何将查询保存在内存中以显示在 DBgrid 中, 我当前的应用程序正在使用: TZConnection > TZquery > 数据源 > DBgrid 工作正常,但这里的问题是,在调用 Z
在 Firebird/Interbase 数据库中,我们有 TIBQuery、TIBTable 和 TIBDataSet,它们具有 FetchAll 方法计算该数据集有多少行。如果我们不调用该方法,这
我在 Delphi 中使用 Zeoslib 访问本地 MySQL 数据库。 我用 TZQuery 对象调用存储过程: ZMakeRankedTable.SQL.Text := 'CALL Make
我在启用共享内存协议(protocol)的情况下启动了本地 MYSQL 服务器。如何使用 ZeosLib 连接到我的服务器?我在哪里指定它正在使用共享内存? 我使用的是 Lazarus(freepas
我正在使用 Zeoslib Delphi 中的库。 我有一个大型多维静态数组,需要将其传输到本地 MySQL 数据库中的一个空表。我怎样才能有效地做到这一点? 只是迭代一百万个插入语句? 最佳答案 您
我在 Delphi 中使用 ZeosLib 通过 TZQuery 对象调用 MySQL 存储过程。在 MySQL 完成存储过程的执行后,我需要立即启动下一个代码块。 我在 MySQL 存储过程的末尾添
我正在尝试连接到远程 MySQL 服务器,但收到此异常错误: *使用旧的(4.1.1 之前)身份验证协议(protocol)的连接被拒绝(客户端选项“secure_auth”已启用)* 我尝试通过将字
我开发了一个使用 PostgreSQL 8.4 RDBMS 的客户端应用程序。 我的应用程序是用 Lazarus 和 ZeosLib 7.2 编写的,用于数据库访问。 我使用了很多存储过程,在特定点上
我有一个绑定(bind)到 DBGrid 的 TZTable (ZEOSlib),现在我需要知道用户更改了哪个特定的 TField。 我尝试过 if NOT (taPositionenArtNrGH.
我在使用 Delphi ZeosLib 和 Delphi 7 将 Unicode 插入 SQL Server 数据库,然后读取插入的值时遇到问题。我创建了一个简单的测试程序,首先插入然后查询插入的值。
我正在使用 MySQL 服务器和 Zeoslib 与 Delphi。我的程序可以远程连接MySQL数据库,但不能连接本地。但是,它不断引发以下错误 - “没有动态库可以找到或无法加载...” 因此,我
我是一名优秀的程序员,十分优秀!