1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
pgCnx->Params->Values["User_Name"] = WideCharToString(edLogin->Text.data());
pgCnx->Params->Values["Password"] = WideCharToString(edPassword->Text.data());
pgCnx->Params->Values["Hostname"] = WideCharToString(edServer->Text.data());
pgCnx->Params->Values["Database"] = WideCharToString(edDatabase->Text.data());
StatusBar->Panels->Items[1]->Text = "Connection en cours...";
try
{
pgCnx->Open();
while(pgCnx->ConnectionState == csStateConnecting);
} catch(EDatabaseError &E)
{
Application->MessageBox("Erreur de connexion", "Erreur de connexion", TMessageButtons() << smbOK, smsInformation, smbOK);
} catch(...)
{
Application->MessageBox("Erreur inconnue","Erreur de connexion", TMessageButtons() << smbOK, smsInformation);
} |
Partager