Hello,
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
CloseQuery(Query);
// Execute query
Query->DatabaseName = DatabaseName;
Query->SQL->Add (SQL); //Exception If RequestLive = True
Query->Prepare();
Query->Open();
}
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?
Thank you.