Hola Angel.Matilla.
Código PHP:
void __fastcall TfLisCar::FormCreate(TObject *Sender) {
Query->Close();
Query->SQL->Text = "SELECT DISTINCT Codigo, Nombre Ls02 WHERE CodPrv = 45 ORDER BY Nombre, Codigo";
try {
Query->Open();
}
catch(Exception *Exc) {
ShowMessahe(Exc->Message);
PostMessage(Handle, WM_CLOSE, 0, 0);
}
}
Sin embargo dependiendo de como realices la creación,
OnCreate podría no ser el evento adecuado, mejor usar
OnShow.
Saludos