如何使用SQLConfigDataSource配置数据源
为什么我使用 char* szDesc;int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s: DESCRIPTION=TOC support source: DBQ=%s: FIL=MicrosoftAccess: \
DEFAULTDIR=D:\\Database:: ","TEST","Database\\Test.mdb");
mlen = strlen(szDesc);
for (int i=0; i<mlen; i++)
{
if (szDesc[i] == ':')
szDesc[i] = '\0';
}
if (FALSE == SQLConfigDataSource(NULL,ODBC_ADD_DSN,\
"Microsoft Access Driver (*.mdb)\0",(LPCSTR)szDesc))
配置的数据源路径不是 D:\\Database\\Test.mdb,而是C:\Documents and Settings\zyd\桌面\DbTest1\Database\\Test.mdb呢 ?