473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

with a linked table is there a way so the link name does not include library

I am using msaccess with db2 but this seems to apply to any odbc linked table. I do not want the libary to be included in the link name
example MISCMFIL_NAMMSP where MISCMFIL is the libray and NAMMSP is the actual table.
When I link the table by default it returns MISCMFIL_NAMMSP
I can manually rename the link but with the number of tables and links I need to process I would prefer that the library not be included at the creation of the link so I could forgo this step
Oct 21 '10 #1
2 1189
NeoPa
32,556 Expert Mod 16PB
The step cannot be foregone, but you can run a procedure in your code to process through all your tables (TableDefs) and rename them to a version of the name which excludes the text "MISCMFIL_".

I know where you're coming from as I did something very similar myself on one of my databases.
Oct 21 '10 #2
NeoPa
32,556 Expert Mod 16PB
You could use code similar to the following :
Expand|Select|Wrap|Line Numbers
  1. Public Sub RenameTables()
  2.     Dim strLeft As String
  3.     Dim tblThis As DAO.TableDef
  4.  
  5.     strLeft = "MISCMFIL_"
  6.     For Each tblThis In CurrentDb.TableDefs
  7.         With tblThis
  8.             If Left(.Name, Len(strLeft)) = strLeft Then
  9.                 Debug.Print "From " & .Name,
  10.                 Call DoCmd.Rename(NewName:=Mid(.Name, Len(strLeft) + 1), _
  11.                                   ObjectType:=acTable, _
  12.                                   OldName:=.Name)
  13.                 Debug.Print " to " & .Name
  14.             End If
  15.         End With
  16.     Next tblThis
  17. End Sub
Lines #9 & #13 are optional, but give a log of all the tables that have been renamed. You will find the results in the Immediate Pane (See Debugging in VBA).
Oct 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Neil | last post by:
I have an Access 2000 MDB file with a SQL 7 back end. I have a main table with 50,000 records; and I have a selections table with 50,000 records for each machine that uses the database (about...
4
by: Neil Ginsberg | last post by:
I have ODBC linked tables to a SQL 7 database in an A2K database. The linked tables do not have the password stored in them, so the first time the user accesses them, they need to enter the SQL...
5
by: dadofgage | last post by:
I have an application that was written in access and it is linked to data on a microsoft SQL server. I have no problems getting the data out of the database but if I want to update the data, I...
3
by: Gerry Abbott | last post by:
I deploy be-fe solutions to clients, and provide them with updates as a web link to the Fe file, wrapped in an installer. I can generally simulate their shares, if they are using a mapped drive. ...
1
by: steph | last post by:
Hi, I've got a problem. (Microsoft Access 2002 SP3) One of our users found a problem in a when accessing a form with a subform: when starting it access crashes leaving the message...
6
by: blue875 | last post by:
A tale of two queries: One query looks like this, and runs fine. We'll call this the "Customer1 query": SELECT Customer1 overall.*, IIf(IsNull(.),0,1) AS IsField, IIf(IsNull(.),0,1) AS...
3
by: sj | last post by:
I have written an application (CW.mde) with a seperate data (Data.mda) file. My Data tables are linked to CW. I want my user to be able to re-link the data.mda when they change location/path of...
9
by: erick-flores | last post by:
If you have access to the database that the linked table is in, modify it there. You can't modify a linked table. Alternatively, you can import the linked table, then it won't be linked any more...
2
by: Roger | last post by:
I've got two tables in sql2005 which have an 'ntext' field when I linked the first table in access97 last week using an odbc data source the access-field type was 'memo' when I link the 2nd...
7
by: colintis | last post by:
Hi guys, I just takeover to continue on a database project with a bug, the code seems all good, but it didn't pass through an execute SQL statement. Here the part of code that stucked: If...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.