View Full Version : SSMA results


sjl
08-24-2011, 02:06 PM
Hi,
I ran SSMA to upsize my tables to SQL Server 2005 (from Access 2010), I then found the linkage file (*.dsn) for linking, and do see that the files linked to SQL are sitting there in my Access DB with my original table names pre-pended with "dbo_".

The only problem is that the original tables are still there as well, and all my queries and forms are still connected to these local files. The only way I see to get my Access front end to read the SQL back end is to manually change the tables that my Queries and Forms read.

I want to be sure, before I go through and manually hook all the Queries/Forms up with the "dbo_" copies of the tables, that this is actually a manual task--not a situation due to not running something correctly.

thanks for any insights....
Sarah

boblarson
08-24-2011, 03:19 PM
You can fix that easily if you want. Delete the local tables and then use this code to change the names of the SQL ones (to remove the dbo_ part):

Function RenameSQLTables()
Dim tdf As TableDef

For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 4) = "dbo_" Then
tdf.Name = Mid(tdf.Name, 5)
End If
Next
End Function

Just put that function into a standard module and then run it from the Immediate Window by typing (or copying)

RenameSQLTables

in and then hitting enter

sjl
08-25-2011, 05:42 AM
Bob,
Thanks so much--it worked in a flash. As usual, you are so helpful. Have a great day!

Sarah:)