PLMM问我ACCESS怎么用SQL语句改字段类型为自动编号?
解决方案 »
- 急!!!保存checkbox的选中状态
- VB使用API点击外部程序的TListView的问题
- VB访问sqlite数据库
- 好长时间了。。。终于注册成功了一个马甲。。。。我保证不会倒分,哈哈~~~~所以来散出50%分~~~~
- 菜鸟问题,在线,急!!!!!!!
- 类似QQ的抽屉控件,在VB里面怎么实现?有人做过吗?
- 怎样使listview中的listview1.listitems(i).text不可编辑?
- vb能够调用execl中的"规划求解"么?
- 请问以下代码何处错了?为何新按钮a创建不出来??
- 我想听听大家对微软大学生软件设计大塞的看法
- 如何实现运行程序修改文本文件并打印,但是退出程序后文本文件仍旧保持原样不变。
- UserControl中怎么响应消息
Sub CreateAutoNumberField(strDBPath As String)
Dim catDB As ADOX.Catalog
Dim tbl As ADOX.Table Set catDB = New ADOX.Catalog
' Open the catalog.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strDBPath Set tbl = New ADOX.Table
With tbl
.Name = "Contacts"
Set .ParentCatalog = catDB
' Create fields and append them to the
' Columns collection of the new Table object.
With .Columns
.Append "ContactId", adInteger
' Make the ContactId field auto-incrementing.
.Item("ContactId").Properties("AutoIncrement") = True
.Append "CustomerID", adVarWChar
.Append "FirstName", adVarWChar
.Append "LastName", adVarWChar
.Append "Phone", adVarWChar, 20
.Append "Notes", adLongVarWChar
End With
End With ' Add the new Table to the Tables collection of the database.
catDB.Tables.Append tbl Set catDB = Nothing
End Sub