Page 1 of 1
Invalid Variant Operation
Posted: Mon 26 Sep 2011 11:58
by tebowner
I am using Delphi 5 with latest MyDAC and DevExpress
I have a simple 2 TQuery Master Detail setup with 2 master detail DevExpress grids. All works except when i click inside the master grid from a record WITH detail records to a record WITHOUT detail records - i get Invalid Variant Operation and then keep getting this over and over.
Also my Date field in the detail record - when i click on the Date in the grid I get 'control has no parent window'
am i wondering if Date field in the detail is an issue? or could it be that the detail table is using an autoinc for the primary key and that an issue?
Posted: Mon 26 Sep 2011 15:55
by AndreyZ
Hello,
Please specify a script to create your master and detail tables, and the fields that you use to establish the master/detail relationship. Also please try reproducing this problem using the standard TDBGrid component.
Invalid Var Oper - code added
Posted: Mon 26 Sep 2011 16:49
by tebowner
Hello

Yes I did reproduce with DBGrid …
See my sample project. I get this error on the insertion of the master table when there are no detail records. Invalid Variant Operation
http://www.tebowner.com/test.zip
Posted: Tue 27 Sep 2011 09:34
by AndreyZ
Unfortunately, I still cannot reproduce the problem. Your sample project works correctly without any errors. Please check if you are using any dataset event handlers in your application where you perform some operations. It's most likely that this problem is caused by them.
Posted: Tue 27 Sep 2011 11:26
by tebowner
are you using Delphi 5? I am getting the issue when I insert into the Master table and then move rows or enter data and move rows. could it be the version of My SQL? maybe certain MY SQL settings? Delphi 5 version?
I dont have any code in that sample app.
Delphi 5.0 Build 6.18 Update Pack 1- Windows 2000 (Build 2600) Service Pk 3
Mysql
* Server: localhost via TCP/IP
* Server version: 5.5.15
* Protocol version: 10
* User: root@localhost
* MySQL charset: UTF-8 Unicode (utf8)
Web server
* Apache/2.2.4 (Win32) PHP/5.2.3
* MySQL client version: 5.0.37
* PHP extension: mysql
phpMyAdmin
* Version information: 3.3.1
Posted: Wed 28 Sep 2011 11:13
by tebowner
also... I had a Delphi friend also test this on his Delphi and it worked OK for him. Same project, same code, same DB, same MyDAC. what can be the factor?
Posted: Fri 30 Sep 2011 15:41
by AndreyZ
I've checked this question using MyDAC 7.0.1, MySQL 5.5.15, and Delphi 5 (Build 6.18) Update Pack 1. There were no problems. Maybe you changed the source code of MyDAC or Delphi 5, and that causes the error. You can try reinstalling Delphi 5 and MyDAC, and check if the problem persists.
Posted: Fri 30 Sep 2011 20:20
by tebowner
its very strange but... i reinstalled MyDAC and now it seems to be better. Its the Trial version - at first it was popping up the trial window on run and in dev but now its not. could this be an issue with the trial version?
Posted: Wed 05 Oct 2011 10:28
by AndreyZ
It's a strange situation, because MyDAC 7.0.1 trial and licensed versions work absolutely in the same way, and there is no difference between these versions, except the fact that you cannot include MyDAC libraries from trial version into your project (you have to supply them with your project). I've checked this problem with MyDAC 7.0.1 Trial Edition and there were no problems with it.
Posted: Wed 05 Oct 2011 12:56
by tebowner
WEIRD... i know ... i cant seem to figure it out ... i also have an issue where I get Parent "" No Control Window on any data droip down in my grid (devexpress) i thought this issue could be related?
Posted: Thu 06 Oct 2011 09:52
by AndreyZ
You can try the following:
- uninstall MyDAC and Delphi 5;
- install Delphi 5 without Update Pack 1;
- install MyDAC and check if these problems persist;
- install Update Pack 1 for Delphi 5 and check if these problems persist again.
If you can reproduce these problems both with and without Update Pack 1 for Delphi 5, please try creating a small sample to demonstrate problems and send it to andreyz*devart*com, including a script to create and fill the master and detail tables.
Posted: Thu 06 Oct 2011 12:18
by tebowner
OK i think i know my issue possibly - i am not sure if it effected this problem but I did solve my issue where the date fields were giving me Parent "" Control window issue.
I was opening my queries in the Form.Activate event. this event was firing when a date field opened the date window. this messed up the selected rec as the query was closed/opened