Solved

SQL Server backend dbo table prefix

Posted on 2014-04-22
5
1,053 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 143

Expert Comment

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

Expert Comment

by:Dulton
ID: 40015237
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 50

Assisted Solution

by:Gustav Brock
Gustav Brock earned 100 total points
ID: 40016970
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
ID: 40017176
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 36

Expert Comment

by:PatHartman
ID: 40018740
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of utilizing SQL Server views 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 Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

696 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