Thread: [FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".
 |
This question is not answered.
Helpful answers available: 2.
Correct answers available: 1.
|
Posts:
3
Registered:
9/7/17
|
|
I have one software which is using TMS Scripter and for being as a user i want to extend functionality by using DLL,
I write the DLL in Delphi work fine with Delphi application and Lazarus, but when i try to use that DLL to get a result from a database (SQLite) got following error.
Exception ESQLiteNativeException in module drofrc.dll at 0024006A.
[FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".
Select Statement in DLL
FDQuery1.SQL.Text:= 'Select RCode from FordRCBSerial Where VSerial =' + Buffer;
|
|
|
Posts:
687
Registered:
3/24/05
|
|
FDQuery1.SQL.Text:= 'Select RCode from FordRCBSerial Where VSerial =' + Buffer;
Yes, but what is Buffer? Maybe Buffer is an empty string in case of the error?!
Try (always..) to parameter the buffer, like:
FDQuery1.SQL.Text:= 'Select RCode from FordRCBSerial Where VSerial = :BUFFER';
FDQuery1.ParamByName('BUFFER').AsString:=Buffer;
If your Buffer is difficult to debug (DLL) , try to make a save to file or so to check what's in the Buffer var.
|
|
|
|
Posts:
29
Registered:
1/5/02
|
|
FDQuery1.SQL.Text:= 'Select RCode from FordRCBSerial Where VSerial =' + Buffer;
I agree Robert Triest the parameter method is the best way, if you want to use the string concatenation don't forget the quotes for strings
FDQuery1.SQL.Text:= 'Select RCode from FordRCBSerial Where VSerial =' + QutotedStr(Buffer);
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us