[ADO C++]Execution instruction oracle error
rixan
Messages postés
438
Statut
Membre
-
rixan Messages postés 438 Statut Membre -
rixan Messages postés 438 Statut Membre -
Bonjour,
Je précise que je travaille avec Oracle
J'ai ce code:
if (m_pConnection->State == adStateOpen)
{
USES_CONVERSION;
strQuery.Format(_T("SELECT COUNT(*) AS %s FROM user_tables WHERE table_name = '%s'"), strFieldName, W2T(a_wstrTableName.c_str()));
_variant_t varRowsAffected;
_RecordsetPtr rs = m_pConnection->Execute(strQuery.GetString(), &varRowsAffected, adOptionUnspecified);
if (! rs->BOF || ! rs->adoEOF)
{
rs->MoveFirst();
_variant_t varValue = rs->Fields->Item[T2W(strFieldName.GetString())]->Value;
bRes = CUtils::GetIntFromVariant(varValue) == 1;
}
}
Le problème c'est que ce COUNT(*) retourne rs = 0 VT_INT.
Je copie alors la chaîne strQuery à partir de son espion et je le teste sous SQL+ de Oracle Client : ça marche très bien et ça retourne 1 !!
Quel est bien donc mon soucis ?
Je précise que je travaille avec Oracle
J'ai ce code:
if (m_pConnection->State == adStateOpen)
{
USES_CONVERSION;
strQuery.Format(_T("SELECT COUNT(*) AS %s FROM user_tables WHERE table_name = '%s'"), strFieldName, W2T(a_wstrTableName.c_str()));
_variant_t varRowsAffected;
_RecordsetPtr rs = m_pConnection->Execute(strQuery.GetString(), &varRowsAffected, adOptionUnspecified);
if (! rs->BOF || ! rs->adoEOF)
{
rs->MoveFirst();
_variant_t varValue = rs->Fields->Item[T2W(strFieldName.GetString())]->Value;
bRes = CUtils::GetIntFromVariant(varValue) == 1;
}
}
Le problème c'est que ce COUNT(*) retourne rs = 0 VT_INT.
Je copie alors la chaîne strQuery à partir de son espion et je le teste sous SQL+ de Oracle Client : ça marche très bien et ça retourne 1 !!
Quel est bien donc mon soucis ?
A voir également:
- [ADO C++]Execution instruction oracle error
- Fan error lenovo - Forum Refroidissement
- Eespt technical error ✓ - Forum TNT / Satellite / Réception
- Pour ceux qui ont "LENOVO fan error au démarrage" - Forum PC portable
- Pointage antenne trop faible - Forum Box et Streaming vidéo
- Cmos checksum error ✓ - Forum Carte-mère/mémoire