Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
TQuery Object, RequestLive true causes 'missing right quote' exception
I am working with an old legacy project that used the BDE. It has been giving me a fair amount of heartache. I was able to establish a connection to the database using an alias and by creating a system DSN....However, eventually I need to make the database DSN-less. (issue for a later post).
For now, I have "hot-wired" the database into the project and I am able to connect to the database by setting connected = true on the *.dfm . This is good. Now, I run into issues with a TQuery object.
The code runs through and connects to the database itself. Then the code attempts the following function call on the TQuery object. The first call is in one file and the definition is shown below:
BDEUtil::OpenQuery(Settings, "SELECT * FROM Settings", databaseSettings->DatabaseName);
void BDEUtil::OpenQuery(TQuery *Query, String SQL, String DatabaseName)
// Close existing query
// Execute query
Query->DatabaseName = DatabaseName;
Query->SQL->Add (SQL); //Exception If RequestLive = True
The line Query->SQL->Add (SQL); crashes if RequestLive = true (which is what I need it to be because I have to edit this database). The exception thrown is:
"raised exception class EDBEngineError with message 'Missing right quote.'.
However, if I set this to false, the code runs fine...only to complain later about not being able to edit the database on a ->Edit(); call on the TQuery object. Anyone have any idea what the issue would be?