try{

m_pRst->Open(strSql.GetBuffer(0), // 查询Table表中所有字段
theApp.m_pConnection.GetInterfacePtr(),  // 获取库接库的IDispatch指针
adOpenDynamic,
adLockOptimistic,
adCmdText);
}
catch(_com_error OpenErr){
AfxMessageBox(OpenErr.Description());
return FALSE;
}
铺捉到错误为:[Microsoft][ODBC Microsoft Access Driver]参数不足,期待是1。改怎么解决阿???在先等

解决方案 »

  1.   

    摘自http://forums.aspfree.com/t19858/s3cec8ce36defd3f83ca051027724ebbc.html
    Doug G
    Moderator:Often this error is caused by a mis-typed colu,mn name in the sql statement.Some day I'll figure out how to post code here too 意思是传递的列参数应该为单银号包装,即'文13-606',而不应该是"文13-606"(双引号).
      

  2.   

    补充:
    造成这个错误的原因是:我把connection的参数换了,具体下面。
    我把下面语句
    m_pConnection->Open("Provider=Microsoft.Jet.OLEDB.4.0;"  "Data Source=C:\\Documents and Settings\\Administrator\\桌面\\yl\\yldb.mdb","Admin","",adConnectUnspecified);
    改为:
    m_pConnection->Open("ylsj",//一个ODBC数据源名称
    "Admin","",adConnectUnspecified);