EAssertionFailed with message "Wrong DataSet"

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
PoSeiDoN31
Posts: 6
Joined: Wed 12 Sep 2007 15:35

EAssertionFailed with message "Wrong DataSet"

Post by PoSeiDoN31 » Wed 26 Mar 2008 15:08

Hello, I've been developing a software with delphi 2007 and I'm using the MyDAC components to access a MySQL Database. I will try to explain steo by step my situation. However, it's kind of complicated:

1.- My application has a main Form wich calls another form using a classfunction that i create.

2.- In this classfunction I pass a VirtualTable to the child form, 'cause they both will be working with the same data, so that i don't have to create another VirtualTable.

3.- So in the class function i have a pice of code like this:
class function TFFFormChild(inv: TVirtualTable; a: string; b: String; c: TFloatField): boolean;
var
f: TFFSerialesPt;
begin
f := TFFSerialesPt.Create(Application);
f.DSSeriales.DataSet := inv;
Result := f.ShowModal = mrOk;
end;


DSSeriales is a datasource that is placed in the child form and as you can see i assign the dataset "inv" to it.

4.- Later, in another piece of code i try to do an append and copying some data to that dataset using the sentences:

DSSeriales.Dataset.Append;
DSSeriales.Dataset.FieldByName('a').AsString := 'Anything';
DSSeriales.Dataset.Post;


At this point i get an exception that says EAssertionFailed with Message "Wrong DataSet" and it points to the unit MemDS.pas

I'll appreciate any kind of help that you could give me.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 28 Mar 2008 08:14

We could not reproduce the problem.
Please send a complete small sample to dmitryg*crlab*com to demonstrate it, including script to create and fill table.

Post Reply