Solved

SQL Server backend dbo table prefix

Posted on 2014-04-22
5
1,021 Views
Last Modified: 2014-08-01
I have an Access 2010 frontend with an Access 2010 backend.   The IT dept took the Access backend and created a SQL Server backend.  When I OBDC to the new backend all the tables have a dbo prefix.  The Access frontend does not recognize the tables.  

When the Access backend is upsized into SQL server is there a way to not have the dbo prefix or will all the tables need to be individually renamed?
0
Comment
Question by:Sasha42
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
if the login you use has db_owner permissions, the dbo table prefixes should not be needed.
0
 
LVL 6

Expert Comment

by:Dulton
Comment Utility
When the Access backend is upsized into SQL server is there a way to not have the dbo prefix or will all the tables need to be individually renamed?

If the front-end is using them via linked table references... they'll have to be renamed.
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 100 total points
Comment Utility
Yes and no. You write a small function that loops the tabledefs and renames the dbo_sometablename tables to just sometablename.

/gustav
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
Comment Utility
As gustav mentions you can just rename the tabledefs. Here's a simple code loop that will do so:

Dim tdf As DAO.TableDef
Dim dbs As DAO.Database

Set dbs = CurrentDB

For each tdf in dbs.TableDefs
  If Left(tdf.Name, 3) = "dbo" Then
    '/ the prefix is "dbo_", so we trim off the first 4
    tdf.Name = Right(tdf.Name, Len(tdf.Name-4)
  End If
Next
0
 
LVL 34

Expert Comment

by:PatHartman
Comment Utility
The Access upsizing wizard takes care of this for you by removing the owner prefix in the final step when it relinks the upsized tables.  When you link manually, you need to fix the problem manually or by using the code posted by Scott.

You can use the following query to see the actual table name vs the local table name.  The Name column is the name of the table as you see it in the navigation pane.  The ForeignName is the name of the table as you see it in the remote database.  So after you run Scott's update procedure, this query will show you the changes.


SELECT MSysObjects.Connect, MSysObjects.Name, MSysObjects.ForeignName, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=4));
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now