关闭

SQLGetInstalledDrivers 获取ODBC已经安装的驱动列表

105人阅读 评论(0) 收藏 举报
分类:


#include <ODBCINST.H>
void GetSQLDriverList()
{
  TCHAR szDrivers[4096];
  memset(szDrivers, 0, sizeof(szDrivers));
  WORD wRet = 0;
  if(SQLGetInstalledDrivers(szDrivers, sizeof(szDrivers), &wRet))
  {
    TRACE(_T("Installed driver list:\n"));
    LPTSTR pszDrv = szDrivers;
    while(*pszDrv)
    {
      TRACE(_T("%s\n"), pszDrv);
      
      pszDrv += _tcslen(pszDrv) + 1;
    }
    TRACE(_T("\n"));      
  }
}

//调试输出

Installed driver list:
SQL Server
Microsoft Access Driver (*.mdb)
Microsoft Text Driver (*.txt; *.csv)
Microsoft Excel Driver (*.xls)
Microsoft dBase Driver (*.dbf)
Microsoft Paradox Driver (*.db )
Microsoft Visual FoxPro Driver
Microsoft FoxPro VFP Driver (*.dbf)
Microsoft dBase VFP Driver (*.dbf)
Microsoft Access-Treiber (*.mdb)
Microsoft Text-Treiber (*.txt; *.csv)
Microsoft Excel-Treiber (*.xls)
Microsoft dBase-Treiber (*.dbf)
Microsoft Paradox-Treiber (*.db )
Microsoft Visual FoxPro-Treiber
Driver do Microsoft Access (*.mdb)
Driver da Microsoft para arquivos texto (*.txt; *.csv)
Driver do Microsoft Excel(*.xls)
Driver do Microsoft dBase (*.dbf)
Driver do Microsoft Paradox (*.db )
Driver para o Microsoft Visual FoxPro
Microsoft ODBC for Oracle
Microsoft FoxPro Driver (*.dbf)
SQL Native Client

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:293601次
    • 积分:5137
    • 等级:
    • 排名:第5770名
    • 原创:183篇
    • 转载:0篇
    • 译文:2篇
    • 评论:114条
    最新评论