char* szDesc;
int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s? DESCRIPTION=TOC support source? DBQ=%s? FIL=MicrosoftAccess? DEFAULTDIR=%s?? ","lhwy",lpszFile,sPath); 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))
AfxMessageBox("SQLConfigDataSource Failed");菜菜的问题是:
1。为什么要将?提换成\0呢?
2。?是什么意思呢
3。\0是什么意思呢
int mlen;
szDesc=new char[256];
sprintf(szDesc,"DSN=%s? DESCRIPTION=TOC support source? DBQ=%s? FIL=MicrosoftAccess? DEFAULTDIR=%s?? ","lhwy",lpszFile,sPath); 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))
AfxMessageBox("SQLConfigDataSource Failed");菜菜的问题是:
1。为什么要将?提换成\0呢?
2。?是什么意思呢
3。\0是什么意思呢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货