Solved

SQL Server backend dbo table prefix

Posted on 2014-04-22
5
1,077 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 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 85

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 38

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

632 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