473,804 Members | 3,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1212
NeoPa
32,579 Recognized Expert Moderator MVP
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,579 Recognized Expert Moderator MVP
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
2698
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 25-50). This allows each user to have their own set of selections. The selections table has three fields: ID (int), Sel (bit), MachName (varchar). ID and MachName comprise the primary key. I have a view that combines the main table and the entries...
4
18967
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 password. I am developing a process that will automatically run at night which will access those tables. I need to be able to give Access the password, as the user currently does, so that the process can run without a password prompt appearing....
5
2690
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 get an error. So now I sit in the list of tables in access and double click on the table name to view the data in datasheet view. No problem. If I change anything and move to another record, I get the 'this record
3
4567
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. However if they are not using mapped drives, and are using their own domain server address, then I cannot simulate that so easy. Can i manually change the address where the linked table objects point, before deployment.? (I cant do it with a...
1
2396
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 "MSACCESS.EXE - Application Error ... The instruction at "..." referenced memory at "...". The memory could not be read". Now if I remove the subform from this form this error does not appear
6
6545
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 IsStaff FROM ( LEFT JOIN ON .=.) LEFT JOIN
3
9826
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 the data.mda. Hence, I have an button with the following: DoCmd.RunCommand acCmdLinkedTableManager The button works on the computer with Ms Access but not those that on
9
4578
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 and you can modify it. There are potential problems with this strategy, as you will be working on a copy of the original table, so any new data that goes into the original table from elsewhere will not be reflected in your database. Hello all
2
3390
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 table today, it is linked as a text(255) field, ditto for the first table if I link it today if I link the 2nd table using access2003 (and the same odbc data source) it is linked as a memo field
7
2646
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 main.UserAction = main.UserSelected Then myDb.Execute "INSERT INTO ArchiveEmployees SELECT * FROM Employees WHERE ID=" & If myDb.RecordsAffected = 1 Then ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10583
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.