# 建立自定义属性出错:无效操作

Posted by BANYUE on August 07, 1998 at 21:50:19:

Public Sub DB1_18(TableObj As TableDef)

Dim Shzhuindex As Index
Dim Myproperty As Property
'建立索引
Set Shzhuindex = TableObj.CreateIndex("PramIdx")
Set Myproperty = Shzhuindex.CreateProperty("Indexfiled",_ dbText,"23") '建立自定义属性
Shzhuindex.Properties.Append Myproperty (?)
Shzhuindex.Primary = True
Shzhuindex.Unique = True
'建立字段
With TableObj
.Fields.Append .CreateField("Net_name", dbSingle)
.Fields.Append .CreateField("Line_name", dbSingle)
.Fields.Append .CreateField("LuXianWFC_LMT", dbSingle)
.Fields.Append .CreateField("ZuoYou_LMT", dbSingle)
.Fields.Append .CreateField("FHLXBHC_LMT", dbSingle)
.Fields.Append .CreateField("QHSJC_LMT", dbSingle)
End With
Shzhuindex.Fields = "Net_name;Line_name"
TableObj.Indexes.Append Shzhuindex
db.TableDefs.Append TableObj
End Sub
当执行到(?)行时程序出错:无效操作

请问这是何原因?THANK YOU VERY MUCH!!

Follow Ups: