'首先 , 作如下测试工作:
'新建空白 Access 数据库 (.mdb) 文件,
'并添加若干类型链接表:
'dBase 5 (*.dbf)、
'Microsoft Excel (*.xls)、
'Microsoft Access (*.mdb;*.mda;*.mde) 等,
'然后再编写如下 VB6 程序:
'Delphi、VC 等程序同理也可:
'引用 Microsoft ActiveX Data Objects 2.x Library
'引用 Microsoft ADO Ext. 2.x for DDL and Security
'控件: Form1、Command1、Command2、Command3
Private Sub Command1_Click() '测试链接表信息
Dim adoConnection As New ADODB.Connection
adoConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:/LnkTbls.mdb;Persist Security Info=False;Jet OLEDB:Database Password=123"
Dim adoCatalog As New ADOX.Catalog
Set adoCatalog.ActiveConnection = adoConnection
Dim adoTable As New ADOX.Table
Set adoTable.ParentCatalog = adoCatalog
Dim i As Integer
For Each adoTable In adoCatalog.Tables
If adoTable.Type = "LINK" Then
Debug.Print adoTable.Nam
编程管理(添加、删除、刷新) Access 链接表信息
最新推荐文章于 2017-06-06 14:18:47 发布