Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: [FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Apr 23, 2018 12:43 AM Last Post By: Serge Girard Threads: [ Previous | Next ]
fiaz ahmad

Posts: 3
Registered: 9/7/17
[FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2018 8:22 AM
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;
Robert Triest

Posts: 687
Registered: 3/24/05
Re: [FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 12:11 AM   in response to: fiaz ahmad in response to: fiaz ahmad
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.
Serge Girard

Posts: 29
Registered: 1/5/02
Re: [FireDAC][Phys][SQLite] ERROR: unrecognized token: "'".  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 23, 2018 12:43 AM   in response to: fiaz ahmad in response to: fiaz ahmad
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)

Server Response from: ETNAJIVE02