设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 2007|回复: 6
打印 上一主题 下一主题

[Access本身] 如何链接改了后缀名的数据库?

[复制链接]
1#
发表于 2007-12-2 21:29:46 | 显示全部楼层
是手工连接还是用代码?
手工指定用ACCESS打开啊
用代码把数据库的名字的后缀改了就可以了啊! 比如db1.LIB
2#
发表于 2007-12-6 18:39:43 | 显示全部楼层
如果是用代码链接的话——把数据库的名字后缀改了就可以了

Dim cnn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim tbl As Table
cnn.Open "provider=Microsoft.jet.OLEDB.4.0;data source=" & CurrentProject.Path & "\db1.LIB;Jet OLEDBatabase Password=" & mima & ";"
cat.ActiveConnection = cnn
For Each tbl In cat.Tables
    GetTblName = tbl.Name
    If Left(tbl.Name, 4) <> "msys" Then
        IsLink = LinkTbl(CurrentProject.Path & "\db1.LIB", "", GetTblName, GetTblName)
    End If
Next
Set tbl = Nothing
Set cat = Nothing
cnn.Close
Set cnn = Nothing
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-6-3 00:25 , Processed in 0.121616 second(s), 24 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表