D
darlingpeng
Unregistered / Unconfirmed
GUEST, unregistred user!
var<br> tb: TADOTable;<br> iCount: integer;<br> tb:TADOTable;<br> PrimaryKey: String;<br>begin<br> Tb := TADOTable.create(nil);<br> tb.connection := //你的connection<br> tb.TableName := //你的tablename;<br> tb.Active := False;<br> tb.IndexDefs.Update;<br> for iCount := 0 to tb.IndexDefs.Count - 1 do<br> if ixprimary in tb.IndexDefs[iCount].Options then<br> PrimaryKey := PrimaryKey + tb.IndexDefs.Items[0].Fields;<br>end; <br>这是 duhai_lee 这位兄弟写的,但是我执行到 tb.IndexDefs.Update就报错,<br>could not convert varinat of type(null) into type(string) <br>是不是我主键或者索引格式有问题,有哪位哥们知道的,帮帮忙。