| 批量去除链接表名前的"DBO_" |
|
| 作者:zhuyiwen… 文章来源:本站原创 点击数: 本日:{$DayHits} 更新时间:2003-12-17 1:46:05 |
|
通过ODBC连接到SQL Server后,每个连接表都自己加上了“DBO_”,这样使用起来很麻烦,可以通过调用下面的 RenameLinkTableName 过程来进行批量去除之。
' 用途: 批量去除通过ODBC连接到SQL Server链接表名前的"DBO_" ' 要求引用 Microsoft DAO 3.60 Object Library ' 作者: 朱亦文 ' 日期: 2003.12.17 测试通过 Public Sub RenameLinkTableName() Dim dbs As Database Dim tdf As TableDef Dim strNewName As String Dim strName As String Set dbs = CurrentDb For Each tdf In dbs.TableDefs strName = tdf.Name If UCase(Left(strName, 3)) = "DBO" Then strNewName = Right(strName, Len(strName) - 4) tdf.Name = strNewName tdf.RefreshLink End If Next End Sub
|
| 文章录入:zhuyiwen 责任编辑:tm |
|
上一篇文章: 几个常用的身份证相关函数
下一篇文章: 代码与速度优化 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |