Dim cn As ADODB.Connection Dim cat As ADOX.Catalog Set cn = New ADODB.Connection With cn .Provider = "SQLOLEDB" .ConnectionString = "Data Source=(local);Initial Catalog=Northwind;User ID=<UID>;Password=<strong password>;" .Open End With Set cat = New ADOX.Catalog Set cat.ActiveConnection = cn Debug.Print cat.Tables("Customers").Columns("CustomerID").Properties("Autoincrement").Value
2.表
3.数据库
5.主键
不过 主建都是False,我明明设置了主建的
谢谢!具体怎么做!
http://support.microsoft.com/kb/q258013/
http://chenoe.com/blog/blogview.asp?logID=1912
Idx.Properties("Autoincrement")
提示说:在对应的集合中,未找到项目
Dim cat As ADOX.Catalog
Set cn = New ADODB.Connection
With cn
.Provider = "SQLOLEDB"
.ConnectionString = "Data Source=(local);Initial Catalog=Northwind;User ID=<UID>;Password=<strong password>;"
.Open
End With
Set cat = New ADOX.Catalog
Set cat.ActiveConnection = cn
Debug.Print cat.Tables("Customers").Columns("CustomerID").Properties("Autoincrement").Value
怎么还是不行啊!提示错误;
对象或提供程序不能执行所需的操作
cat.tables("Customers").Columns("CustomerID").Properties
集合里面的项目都是 <对象或提供程序不能执行所需的操作>在网上找了N 久代码都是这样写的,我怎么就不能用了,真是郁闷啊!