EDatabaseError field not found

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
777Yves
Posts: 37
Joined: Mon 09 Aug 2010 19:55
Location: Québec

EDatabaseError field not found

Post by 777Yves » Tue 21 May 2013 20:31

Hi, I have a strange message
Project FMRQ.exe raised exception class EDatabaseError with message MyQ_010030: Field 'TYPE' not found
when I run this code from the FMRQ.exe on the dmGest.MyQ_010030.open statement :

Code: Select all

  if RgStage.ItemIndex = 0 then
    sStage := 'left join ' + Gestion + '.fmr1mac gmac on cma.perma = gmac.perma '
  else if RgStage.ItemIndex = 1 then
    sStage := 'left join cumul.fmr1mac cmac on cma.perma = cmac.perma ';

  if RgCourriel.ItemIndex = 0 then
    sCourriel := 'left join cumul.couriel ciel on cma.perma = ciel.PERMA ';

  if RgPointeur.ItemIndex = 0 then
    sPointeur := 'left join ' + Gestion + '.fmr1map gmap on cma.perma = gmap.perma ' ;

  if RgRemarque.ItemIndex = 0 then
    sRemarque := 'left join ' + Gestion + '.fmr1mar gmar on cma.perma = gmar.perma ' ;

  if RgCotis.ItemIndex = 0 then
    sCotisation := 'left join ' + Gestion + '.fmr1mab gmab on cma.perma = gmab.perma ' ;

  if RgImprimerQui.ItemIndex = 0 then
    sQui := 'where cma.perma = ''' + vPerma + ''''
  else
    sQui := 'where cma.perma in (Select perma from local.' + xUser + 'xselres) ';


  dmGest.MyQ_010030.SQL.Clear;
  dmGest.MyQ_010030.SQL.Text :=
    'select * from cumul.fmr1ma cma ' +
    sStage +
    sPointeur +
    sRemarque +
    'left join ' + Gestion + '.fmr1ma  gma  on cma.perma = gma.perma ' +
    sCotisation +
    sQui;

  dmGest.MyQ_010030.Open;

Code: Select all

// This is the code generated that run ok in MySql WorkBench
// This code also run in the MyQuery editor or when I click Active = True in the IDE
select * from cumul.fmr1ma cma 
left join gest2012.fmr1mac gmac on cma.perma = gmac.perma 
left join gest2012.fmr1map gmap on cma.perma = gmap.perma 
left join gest2012.fmr1mar gmar on cma.perma = gmar.perma 
left join gest2012.fmr1ma  gma  on cma.perma = gma.perma 
left join gest2012.fmr1mab gmab on cma.perma = gmab.perma 
where cma.perma = '1017391';
The field is there, everywhere in the table, in Workbench, in MyQuery editor, in fields editor but not when I run the application. I have remove the field from the field editor and I receive a message about the next field in the list 'Adresse'.
Is there a maximum number of fields ???
This query output around an hundred fields and 'TYPE' is around the 60.

Any idea welcome.

Yves

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: EDatabaseError field not found

Post by DemetrionQ » Wed 22 May 2013 10:04

Hello.

MyDAC has no restriction on number of fields in dataset. (Such restriction is only in the MyDAC trial edition for 64-bit OSs - number of fields is limited to 6).

I couldn't reproduce the problem. Please provide the following information:
- the MyDAC version;
- the database version;
- scripts for creating all the tables involved in the query.

In addition, try deleting all fields from the Fields Editor and checking if the problem repeats.

777Yves
Posts: 37
Joined: Mon 09 Aug 2010 19:55
Location: Québec

Re: EDatabaseError field not found

Post by 777Yves » Wed 22 May 2013 13:55

Hi, here are the informations.

MyDac Pro 7.6.11 for RAD Studio XE
MySql 5.5.30-log
Windows 7
Hoops, I found my error. There is a line missing in the select of the .exe .
In the fields editor I have this select:

Code: Select all

select * from cumul.fmr1ma cma
left join cumul.couriel    ciel on cma.perma = ciel.PERMA <-- This line was missing in .exe
left join gest2012.fmr1mac gmac on cma.perma = gmac.perma
left join gest2012.fmr1map gmap on cma.perma = gmap.perma
left join gest2012.fmr1mar gmar on cma.perma = gmar.perma
left join gest2012.fmr1ma  gma  on cma.perma = gma.perma
left join gest2012.fmr1mab gmab on cma.perma = gmab.perma
where cma.perma = '1017391';
That is why I receive the message about a field missing.

Thanks to let me explain my error.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: EDatabaseError field not found

Post by DemetrionQ » Wed 22 May 2013 14:20

Glad to see that you solved the problem.
If any other questions come up, please contact us.

Post Reply