je re�ois une cha�ne de charact�res et je construis un requ�te comme �a:
Mais le COMPILER m'alerte toujous:
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10 AnsiString str; int n; str = Edit1->Text; ADOCommand1->CommandText = ""; ADOCommand1->CommandText = "select * from CDS_Card_Data where ICCID = '"; ADOCommand1->CommandText += str; ADOCommand1->CommandText += "'"; Edit2->Text = ADOCommand1->CommandText; ADODataSet1->Recordset = ADOCommand1->Execute();
Pourquoi est-ce qu'il a caus� cette erreur?
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3 Project TestProject.exe raised exception class EOleException with message '[MicroSoft][ODBC MicroSoft Access Driver]Syntax error in string in query expression 'ICCID ='" Process Stopped. Use Step or Run to continue.
Si je r�dige un requ�te fixe dans la propri�t� CommandText sur la fen�tre "Object Inspector" comme �a:
select * from CDS_Card_Data where ICCID = '89840321080002701056'
par exemple, il marchera bien!!! c'est bizarre!
Merci tous d'avance!
Partager