Delphi Firedac无法识别sqlite3中的新ALTER功能 [英] Delphi Firedac not recognizing new ALTER feature in sqlite3

查看:91
本文介绍了Delphi Firedac无法识别sqlite3中的新ALTER功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQLite3 3.25版和更高版本允许我"ALTER TABLE myTable RENAME COLUMN oldColName TO newColName" .但是,当我在Delphi代码中执行此操作时,出现错误"RENAME附近" ,但是它可以通过命令行或其他实用程序运行新的sqlite3.dll.

SQLite3 release 3.25 and higher allows me to "ALTER TABLE myTable RENAME COLUMN oldColName TO newColName". But I get an error "near RENAME" when I execute this in my Delphi code, but it works running the new sqlite3.dll from the command line or with another utility.

这有效:

HerdConnection.ExecSQL('ALTER TABLE myTable RENAME TO NewNameTable');

此操作失败:

HerdConnection.ExecSQL('ALTER TABLE myTable RENAME COLUMN oldcolName TO NewColName');

自从我安装了新的sqlite3.dll驱动程序以来,列重命名确实可以正常工作,但是在我的Delphi代码(Delphi 10.2 Update 2)中却没有作用

Since i installed the new sqlite3.dll driver, the column re-name does work, but NOT in my Delphi code (Delphi 10.2 Update 2)

我怀疑FireDac附带的sqlite3驱动程序不是最新的,但在我能找到的计算机上到处都切换到了最新的sqlite3.dll.

I suspect the included sqlite3 driver with FireDac is not up to date, but have switched to the newest sqlite3.dll everywhere on the computer i can find.

推荐答案

问题是您更改了FireDac.inc文件后没有任何更改,这是因为编译器使用的是delphi .DCP文件而不是.pas文件我有解决方案,请按照以下步骤操作:

The problem is after you change the FireDac.inc file nothing change ,that because the compiler use delphi .DCP files not .pas files I have the solution ,i just make it please follow these steps :

0-close delphi .
1- go to (C:\Program Files\Embarcadero\Studio\20.0\source\data\firedac) open FireDac.inc then remove (.) from line ({.$UNDEF FireDAC_SQLITE_STATIC}) then save it.
2- download the lase version of Sqlite3.dll .
3- go to (C:\Program Files\Embarcadero\Studio\20.0\bin)and replacing the old sqlite3.dll.  
4- go to your application exe folder and past the sqlite3.dll . 
5- open delphi and make new vcl application (debudg build) name it (myfire) and save it in new folder name it (fires).
6-go to (C:\Program Files\Embarcadero\Studio\20.0\source\data\firedac) and copy the following files to the (fires) folder :
a-FireDAC.Comp.BatchMove.SQL.pas
b-FireDAC.Phys.SQLite.pas
c-FireDAC.Phys.SQLiteCli.pas
d-FireDAC.Phys.SQLiteDef.pas
e-FireDAC.Phys.SQLiteMeta.pas
f-FireDAC.Phys.SQLiteVDataSet.pas
g-FireDAC.Phys.SQLiteWrapper.pas
h-FireDAC.Stan.SQLTimeInt.pas
i-FireDAC.Phys.SQLGenerator.pas
j-FireDAC.Phys.SQLPreprocessor.pas
7- add those file to (myfire) project and compile the project and close delphi.
8- go to (myfire) exe folder you will see .DCP files have the same name of 10 .pas files you added before. 
9- copy those 10 .DCP files and past them in (C:\ProgramFiles\Embarcadero\Studio\20.0\lib\win32\debug).
10-make the same steps form step 5 to 9 for (release build).
11-open delphi to your main project and recompile it then try (RENAME COLUMN) it will be work. 

这篇关于Delphi Firedac无法识别sqlite3中的新ALTER功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆