|
阅读:1994回复:2
出现Automation错误是什么原因?急急!!
Set pDiffCursor = pChildTable.Differences(pParentTable, esriDifferenceTypeInsert, pQueryFilter)
pDiffCursor.Next OID, pRow Do Until OID = -1 Set pThisRow = pTable.GetRow(OID) If Not pThisRow Is Nothing Then pWSE.StartEditOperation Dim StrDateAndTime As String StrDateAndTime = Now '取现在的时间 Dim index As Integer index = pThisRow.Fields.FindField("CJSJ") pThisRow.<I>value</I>(index) = StrDateAndTime ''出现Automation错误什么原因? <IMG src="http://www.supermap.cn/bbs/images/files/bmp.gif" border=0>此主题相关图片如下: <a href="http://www.supermap.cn/bbs/UploadFile/200462911105793410.bmp" target="_blank" ><IMG src="http://www.supermap.cn/bbs/UploadFile/200462911105793410.bmp" border=0></A> pThisRow.Store pWSE.StopEditOperation End If pDiffCursor.Next OID, pRow Loop |
|
|
1楼#
发布于:2004-06-30 17:08
编辑的是注册为版本化的SDE图层,我就是想给一图层的某个Feature的CJSJ字段赋一个值(这个值为现在的时间),就在赋值时出现Automation错误,而且如果我先选中这个Feature然后再执行这段程序就不会出错,这是什么原因?急急!!
|
|
|
2楼#
发布于:2004-06-29 11:52
<P>出现Automation error 的原因是很多的,当从你的程序看,如果你是编辑未注册的数据库里的图层会出现这个错误。</P><P> Bug: Automation error when using the TableSort CoClass on tables in a database<TABLE><TR><TH vAlign=top>Article ID:</TH><TD vAlign=top>23869</TD></TR><TR><TH vAlign=top>Bug Id:</TH><TD vAlign=top>N/A</TD><TR><TH vAlign=top>Software:</TH><TD vAlign=top> <B>ArcGIS - ArcEditor</B> 8.1, 8.1.2, 8.2, 8.3 <B>ArcGIS - ArcInfo</B> 8.1, 8.1.2, 8.2, 8.3 <B>ArcGIS - ArcView</B> 8.1, 8.1.2, 8.2, 8.3</TD></TR><TR><TH vAlign=top>Platforms:</TH><TD vAlign=top> <B>Windows</B> NT 4.0, 2000, XP</TD></TR></TABLE></P><H4>Description</H4><DIV>The tablesort coclass can be used to return rows in a specific sort order. If this coclass is used with data that is not registered with the geodatabase, it will fail with an automation error.</DIV><P>
</P><H4>Cause</H4><DIV>An ObjectID column is required in order to sort rows with the TableSort colcass.</DIV><H4>Solution or Workaround</H4><DIV>Besides registering with the geodatabase, the following will also solve the problem: <UL><LI>Add a long integer field to the table or use an existing one and create a unique, not null index for it. Populate the field with integer values, making sure all values are unique and no fields are empty. If this field exists, ArcMap will use it like an ObjectID field and the tablesort will succeed. <LI>In ArcGIS 8.3, some existing functionality has been extended to allow the creation of a table or a layer with a sub-set of columns and rows in ArcMap. These tables have ObjectID columns by default. In ArcGIS 8.3, there is a sample for creating these tables. Go to ArcObjects Developer Help > Contents Tab > Samples > Geodatabase > Query Based Tables. </LI></UL></DIV> |
|
|