Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server backend dbo table prefix

Posted on 2014-04-22
5
Medium Priority
?
1,100 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 51

Assisted Solution

by:Gustav Brock
Gustav Brock earned 400 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1600 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 39

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

722 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