Bonjour,
Dans le cas d'une migration BDE en ADO, je me retrouve avec le problème suivant.
Lorsque dans une requête, il y a des paramètres à la fois dans l'expression et dans sa close where, ma requête "ADO" lors de l'évaluation du paramcheck plante sur "mémoire insuffisante".
Si je prends ce cas suivant :
cela plante ( Pour info en BDE cela ne pose aucun problème)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 With MaRequete do begin Close; SQL.Clear; SQL.Add('select Monchamp1,(select Monchamp2 from LaTable2 where Monchamp2 = :PChamp2) from LaTable1 '); SQL.Add('Where Monchamp1 = :PChamp1); ParamCheck := True; ParamByName('PChamp1').Value := 'Test'; ParamByName('PChamp2').Value := 'Test'; Open; end;
par contre dans les 2 cas qui suivent cela passe normalement
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 // Le paramètre est uniquement dans la close where With MaRequete do begin Close; SQL.Clear; SQL.Add('select Monchamp1,(select Monchamp2 from LaTable2 where Monchamp2 = 'Test') from LaTable1 '); SQL.Add('Where Monchamp1 = :PChamp1); ParamCheck := True; ParamByName('PChamp1').Value := 'Test'; //ParamByName('PChamp2').Value := 'Test'; Open; end;Avez vous une idée , d’où pourrait venir le problème ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 // Le paramètre est uniquement dans l’expression With MaRequete do begin Close; SQL.Clear; SQL.Add('select Monchamp1,(select Monchamp2 from LaTable2 where Monchamp2 = 'Test') from LaTable1 '); SQL.Add('Where Monchamp1 = 'Test'); ParamCheck := True; //ParamByName('PChamp1').Value := 'Test'; ParamByName('PChamp2').Value := 'Test'; Open; end;
Merci pour vos réponses.
Partager