Bonjour

J'essaye de mettre le résultat d'un select dans un tableau. Le problème c'est que quand j'execute mon programme j'ai le message d'erreur : "Opération de pointeur incorrecte". J'ai beau chercher sur le net, je ne trouve pas l'erreur dans mon code...

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    query_corUpd.Close;
    query_corUpd.sql.clear;
    query_corUpd.sql.add('select IDTABLE from '+NomTable);
    query_corUpd.sql.add('where ANOMALIE = ''CM'' and CORRVILLE = '''+trim(copy(ville.Text,1,32))+''' and CORRCP = '''+cp.Text+'''');
    query_corUpd.open;
    //query_corUpd.first;
    SetLength(tabid,query_corUpd.RecordCount-1);
    i := 0;
    while not query_corUpd.eof do
    begin
         tabid[i] := query_corUpd.Fieldbyname('IDTABLE').AsString;
         Inc(i);
         query_corUpd.next;
    end;
Quelqu'un voit-il où est mon erreur ?
Merci