在SuperMap处理过程中遇到一个问题
对soDatasetVector进行Query得不到结果,返回null
以下是及时窗口的分析过程
objDtv.RecordCount
1
objDtv.ClearRecordsets ()
true
objDtv.ReBuildSpatialIndex()
“ReBuildSpatialIndex”方法没有采用“0”个参数的重载
objDtv.ReBuildSpatialIndex(true)
true
objDtv.Open ();
true
objDtv.RecordCount
1
soRecordset cao = objDtv .Query ("1>0",true,null,"");
类型名称或命名空间名称“soRecordset”在此范围内无效
SuperMapLib.soRecordset cao =objDtv .Query ("1>0",true,null,"");
null
objDs.Datasets.Count
87
SuperMapLib.soRecordset cao =objDtv .Query ("1>0",false ,null,"");
已在此范围定义了名为“cao”的局部变量。
SuperMapLib.soRecordset cao1 =objDtv .Query ("1>0",false ,null,"");
null
objDtv.ReBuildSpatialIndex (true)
true
SuperMapLib.soRecordset cao1 =objDtv .Query ("1>0",false ,null,"");
已在此范围定义了名为“cao1”的局部变量。
SuperMapLib.soRecordset cao2 =objDtv .Query ("1>0",false ,null,"");
null
objDtv .Flush ()
true
objDtv .Open ()
true
SuperMapLib.soRecordset cao3 =objDtv .Query ("1>0",false ,null,"");
null
SuperMapLib.soDataSource caoDS = SmSpatialCommon.GlobalResource.SoDataSource ;
{System.__ComObject}
[System.__ComObject]: {System.__ComObject}
SuperMapLib.soDatasetVector caoDV = caoDS.Datasets["Map_ImgTableTemp"] as SuperMapLib.soDatasetVector ;
{System.__ComObject}
[System.__ComObject]: {System.__ComObject}
SuperMapLib .soRecordset caoRs = caoDV.Query ("1>0",false,null,"");
null
SuperMapLib.soError caoe = new SuperMapLib.soError ();
{SuperMapLib.soErrorClass}
[SuperMapLib.soErrorClass]: {SuperMapLib.soErrorClass}
SuperMapLib .soRecordset caoRs1 = caoDV.Query ("1>0",false,null,"");
null
caoe.LastMsgError
“SuperMapLib.soError”并不包含“LastMsgError”的定义
caoe.LastErrorMsg
"[2008-9-22 15:54:15 错误] 查询选项错误。"
SuperMapLib .soRecordset caoRs2 = caoDV.Query ("SmID =1",false,null,"");
null
caoe.LastErrorMsg
"[2008-9-22 15:54:15 错误] 查询选项错误。"
SuperMapLib.soStrings caostring = new SuperMapLib.soStringsClass ();
{SuperMapLib.soStringsClass}
[SuperMapLib.soStringsClass]: {SuperMapLib.soStringsClass}
SuperMapLib .soRecordset caoRs3 = caoDV.Query ("SmID =1",false,caostring,"");
null
caoe.LastErrorMsg
"[2008-9-22 15:54:15 错误] 查询选项错误。"
SuperMapLib.soStrings caostr2 = new SuperMapLib.soStringsClass();
{SuperMapLib.soStringsClass}
[SuperMapLib.soStringsClass]: {SuperMapLib.soStringsClass}
caostr2.Add("SmID");
true
SuperMapLib .soRecordset caoRs4 = caoDV.Query ("SmID =1",false,caostr2,"");
{System.__ComObject}
[System.__ComObject]: {System.__ComObject}
caoRs4.Delete();
true
caoRs4.Update();
0
继续用Deskpro分析,发现其中一个字段加入到查询结果中的时候,继续报错
结论,及处理方法:
这可能是这个字段出现了错误,把这个字段删除,然后重新加上,就可以了