mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 22:31:23 +01:00
[2127319] ODBC fails to detect drivers w/ unixODBC
This commit is contained in:
parent
e9cdfc6247
commit
d67bccf359
@ -63,20 +63,30 @@ Utility::DriverMap& Utility::drivers(Utility::DriverMap& driverMap)
|
||||
SQLSMALLINT len2 = length;
|
||||
RETCODE rc = 0;
|
||||
|
||||
while (!Utility::isError(rc = Poco::Data::ODBC::SQLDrivers(henv,
|
||||
SQL_FETCH_NEXT,
|
||||
desc,
|
||||
length,
|
||||
&len1,
|
||||
attr,
|
||||
len2,
|
||||
&len2)))
|
||||
{
|
||||
driverMap.insert(DSNMap::value_type(std::string((char *) desc),
|
||||
std::string((char *) attr)));
|
||||
std::memset(desc, 0, length);
|
||||
std::memset(attr, 0, length);
|
||||
len2 = length;
|
||||
if (!Utility::isError(rc = SQLDrivers(henv,
|
||||
SQL_FETCH_FIRST,
|
||||
desc,
|
||||
length,
|
||||
&len1,
|
||||
attr,
|
||||
len2,
|
||||
&len2)))
|
||||
{
|
||||
do
|
||||
{
|
||||
driverMap.insert(DSNMap::value_type(std::string((char *) desc),
|
||||
std::string((char *) attr)));
|
||||
std::memset(desc, 0, length);
|
||||
std::memset(attr, 0, length);
|
||||
len2 = length;
|
||||
}while (!Utility::isError(rc = SQLDrivers(henv,
|
||||
SQL_FETCH_NEXT,
|
||||
desc,
|
||||
length,
|
||||
&len1,
|
||||
attr,
|
||||
len2,
|
||||
&len2)));
|
||||
}
|
||||
|
||||
if (SQL_NO_DATA != rc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user