TUniQuery Invalid value Error CodeGear 2007 C++

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
CelerityLLC
Posts: 2
Joined: Thu 04 Oct 2018 18:27

TUniQuery Invalid value Error CodeGear 2007 C++

Post by CelerityLLC » Thu 04 Oct 2018 19:08

I have created a test program to interact with a MongoDB. I have 3 components (that I have added to the form. Insert, Delete and update all work. I am having an issue with Find.

The first time find is called it works and returns expected data. However, I am getting an Invalid value error when assigning text to the TUniQuery from an edit box or a rich edit. The error is occurring before the before the query is activated. Below is the button logic I am using:
void __fastcall TForm1::Button4Click(TObject *Sender)
{
if (!MongoConn->Connected) {
ShowMessage("Connect to db first");
return;
}
if (MongoQuery->Active) {
MongoQuery->Close();
MongoQuery->SQL->Clear();
Mresult->Lines->Clear();
MongoData->Enabled = False;
Button4->Caption="Find";
}
else {
MongoQuery->SQL->Text = mFind->Text;
MongoQuery->Open();
MongoData->DataSet = MongoQuery;
MongoData->Enabled = True;
Button4->Caption="Active";
ShowResults();
}
}

The error is occurring on MongoQuery->SQL->Text = mFind->Text;. Even if using the same search criteria. No matter what I enter, the same invalid value error occurs on the 2nd attempt even if running another insert/delete/update in between finds. Is there a part that I am forgetting to clear?

Thanks, Brad

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: TUniQuery Invalid value Error CodeGear 2007 C++

Post by azyk » Fri 05 Oct 2018 09:37

Thank you for the information. We've reproduced the issue and are investigating it now. We will let you know the results.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: TUniQuery Invalid value Error CodeGear 2007 C++

Post by azyk » Fri 12 Oct 2018 10:33

We fixed the issue. This fix will be included in the next build of UniDAC.

If you want to get this fix before the official release, use the contact form at our site: https://devart.com/company/contactform.html . Provide RAD Studio version and your license number for UniDAC in it and we will send you a night build with this fix. If you don't have a license, then in the contact form, specify RAD Studio version and that you need a trial night build of UniDAC.

CelerityLLC
Posts: 2
Joined: Thu 04 Oct 2018 18:27

Re: TUniQuery Invalid value Error CodeGear 2007 C++

Post by CelerityLLC » Tue 16 Oct 2018 11:29

Thank you!

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: TUniQuery Invalid value Error CodeGear 2007 C++

Post by azyk » Tue 22 Jan 2019 14:13

We fixed the issue and the fix was included to UniDAC 7.4.12.

Note that the TMongoDBUniProvider behavior was changed in UniDAC 7.4.12. Database Commands were removed from the Trial and Professional Editions, and the SQL-92 syntax was added. I.e. the collections should be requested as follows:

Code: Select all

select * from restaurants
Database Commands remain only in the Standard Edition. I.e. the collections should be requested as follows:

Code: Select all

{"find":"restaurants", "filter":{}}

Post Reply