ClientDataSet sql查询找不到参数
AnsiString strsql = "select * from test where id =:vid and name =:vname"
ClientDataSet1-> Params->ParamByName("vid ")-> AsString= strid;
ClientDataSet1-> Params->ParamByName("vname")-> AsString= strName;
ClientDataSet1->ComandText = strsql;
当查询一次后,再次运行代码就找不到参数了,
提示 parameter "vid" not found
[解决办法]
前几个星期也有人问过,用酱子的顺序试试。
AnsiString strsql = "select * from test where id =:vid and name =:vname"
ClientDataSet1->ComandText = strsql;
ClientDataSet1-> Params->ParamByName("vid ")-> AsString= strid;
ClientDataSet1-> Params->ParamByName("vname")-> AsString= strName;
[解决办法]
clientDate清空一下看看
[解决办法]
Params属性加一下参数,再试。
[解决办法]
把冒号加上