这么查询就是出错
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的时候第一种方式都是正确的,还望高手帮忙解答。
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的时候第一种方式都是正确的,还望高手帮忙解答。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货