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


#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

阅读更多
个人分类: 数据库/COM
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

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

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭