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)) = "DBO" Then
strNewName = Right(strName, Len(strName) - 4)
tdf.Name = strNewName
tdf.RefreshLink
End If
Next
End Sub 作者: ljwei692 时间: 2003-11-24 17:17
直接将链接表更改名字可行吗?作者: yodong 时间: 2003-11-25 04:00
问题是100多个表如何个个去改呢?谢谢zhuyiwen版主,我这就去试。作者: cg1 时间: 2003-11-25 04:49
access本来就有RENAME方法,不用太麻烦的
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 作者: yedaoan 时间: 2006-5-16 19:01
谢谢