这么查询就是出错
sSQLStr.Format("select * from \[%s\]",(LPCTSTR)table_name);
bstrSQL = sSQLStr.AllocSysString();
pRst->Open(bstrSQL, pConn.GetInterfacePtr(),adOpenStatic, adLockReadOnly, adCmdTable);
这样就可以正确执行了,但是只是取出了一条记录
sSQLStr.Format("%s",(LPCTSTR)table_name);
bstrSQL = sSQLStr.AllocSysString();
pRst->Open(bstrSQL, pConn.GetInterfacePtr(),adOpenStatic, adLockReadOnly, adCmdTable);
我在处理SQL和EXCEL的时候第一种方式都是正确的,还望高手帮忙解答。