批量去除通过ODBC连接到SQL Server链接表名前的"DBO_"
时间:2006-11-23 23:19 来源:Access开发者 作者:朱亦文 阅读:次
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
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
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
最新内容
推荐内容