[AccessD] A2003 :Rename tables

Darren DICK darrend at nimble.com.au
Thu Mar 30 16:21:02 CST 2006


Thanks Vinnie - I'll try it now
 


Darren
------------------------------
T: 0424 696 433
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of vchas at comcast.net
Sent: Friday, 31 March 2006 9:19 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A2003 :Rename tables

Hi Darren.,
This should do the trick.
Function dbo_Remover() As Integer
' Use this module remove the linked table start name dbo_ 'Dim db As Database
Dim i As Integer Dim c As Long c = 0 Set db =
DBEngine.Workspaces(0).Databases(0)
dbo_Remover = False
db.TableDefs.Refresh
For i = 0 To db.TableDefs.Count - 1
If (Left(db.TableDefs(i).Name, 4) = "DBO_") Then 'MsgBox "found " &
db.TableDefs(i).Name db.TableDefs(i).Name = Mid(db.TableDefs(i).Name, 5) c = c +
1 'MsgBox "new name = " & db.TableDefs(i).Name End If Next i Set db = Nothing
MsgBox "dbo_ Removed From " & c & " Filenames....."
End Function
Vinnie Chas
www.vinniechas.com
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
> Sent: Thursday, March 30, 2006 1:34 PM
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] A2003 :Rename tables
> 
> Hi all
> I have a zillion tables all prefixed with dbo.
> Does anyone have a loop for the TableDef to rename or remove the dbo 
> bit?
> 
> Many thanks
> 
> Darren
> --
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list