Credit goes to FoFa for posting this code on this form.
Attached you will find code to relink tables. I manage I am doing to wrong, and need help in order for it to execute correctly. I would appreciate direction.
What I am doing:
Copying the modules over to my unsplit database.
Creating a form called ReLink.
Setting a macro (AutoExec) to open the the form.
On the form's On Open event placing the function =TestIt
Splitting the database.
Verifying by opening FE that connection exists
Moving BE and reopen FE.
All I get is unable to connect the BE message. Form continues to open.
I have another problem. I am having troubles relinking a front end (secured) database to a back end database and I am not familiar with security so I don't know if it is done through security. The problem is when I copy the backend to backup the front end then using the new address as a link to the frontend.
I didn't design the frontend so I am unable to enter to change the relink if it is secured.
Is there any programs or code (and where do I put it) to change the links. There should be as this is a simple problem.
Does anyone have any db's that show how to relink tables automatically on start up and also remove the links on shutdown, i've been searching everywhere on the net and can't seem to find anything decent, any help would be appreciated.
I have developed a distributed database application in Access 2003 that links to local SQL Server databases in each district office. Recently I updated to Access 2007 on Vista. When I go to relink the application to a district office database I keep getting a ODBC Call Failed error. To relink I delete the old ODBC DSN and created a new one for the particular district office. Current work around involves restarting the whole computer and it only works once. Luckily I still have my XP/Office 2003 computer behind me for now but keen to find out if anyone wlse has experienced similar problems.
I have also uninstalled/reinstalled Office 2007 just in case but no luck.
I am having trouble relinking tables in my Front End database to my Back End database. My BE DB is on a network share and when I try using the link table manager to navigate to the correct folder I get an error message upon entering the network share folder that says:
The Microsoft Access database engine cannot open or write to the file "etworkfolder" It is already opened exclusively by another user, or you need permission to view and write its data.
I have permission to the folder and have ensured that this folder is a trusted location path.
I'm building a database for my company who refurbish computers. I'm wanting to build in functionality for if a hard drive is damaged and it has to be replaced then for us to be able to trace (based on asset and tracking numbers) what hard drive has been removed from a PC and if it has been put into stock or destroyed and if a stock drive has been put into a PC.
Any item that is brought in whether it be a PC, laptop, server or hard drive etc is given it's own unique tracking number. Same is true for any stock we buy in for refurb purposes.
I'm thinking that this will be done by having a field for the original asset number and a field for the 'current' asset I.E. the one it's been put into.
We have a frontend/backend setup and one of the tables has almost 2 million records. I've used the SSMA tool for Access to SQLServer and upsized that table. Seems to have worked well.
Now I'm wondering if I should change the link directly on the frontend or link to the SQLServer from the backend and then update the links on the frontend?I'm mostly concerned about what happens to relationships if I rename the old table and then link to the new SQLServer table.
I have a database with a number of linked tables that are linked to tables in different databases (not a back-end).for example, I have table1 that is linked to table1 in K:databasedb1.mdb.table2 linked to table2 in S:datadata.mdb.and so on...
However, recently we have moved all our databases to a new location.
K:databasedb1.mdb is now residing in O:masterdatabase and S:datadata.mdb is now residing in O:masterdata and so on...
I'm now in charge of relinking all those tables to point to the new location.I would do this in linked table manager one by one but we have 100s of tables linked to multiple different databases in different location.is there a way to create a VBA code that will automatically do this re-linking process?
so, 1. find unlinkable tables 2. search its new location under O:master 3. re-link it to the new location
Database names and tables names have not been changed. Just the location of databases.
We have been using an Access (Access 2013) program where we link the program to dataviews created in sql server.
Recently we had to re-link the data views because a change had been made to them. When we relinked the data we noticed that the field type for the field used as the primary key changed from "Short Text" to "Long Text". The programmer who created the dataview from sql server said that nothing was done at that end that would have caused the change
I know how to prevent the problem from recurring. We are changing the sql server spec from VARCHAR(8000) to CHAR(20).
Hey everyone I'm new here but pretty familiar with Access etc. I am extrememl;y stumped on this and I have never attempted this so any answers and details would be helpful. As we all know this is a learn new things as you develop type of application or at least for me.
I have a database that exists in one building and is functionnig fine using linked tables (File/Get External Data/Link Tables) but I now need to make this same application work for multiple locations which each have its own tables that are seperate from each other location. I was thinking a Main form that opens with radio buttons and based on the one you select would determine which tables it would be linked to when it opens. I figured Radio1 be SEDC, Radio2 be SWDC.
I have a database I have setup as a storage database for just the tables for each location that are on different servers in each location to increase traffic speeds.
Example:
SEDC (RadioButton1) SEDC Database is located on a erver with 50 different tables in it "//sedc1/data/shared/warehouse/SEDC Warehouse.mdb"
SWDC (RadioButton2) SWDC Database is located on server with same tables in it but different data for that location "//swdc1/data/shared/warehouse/SWDC Warehouse.mdb"
I'm trying to delete a table once I've used it and always get the same error saying that the table is already in use, these are the commands I've tried:
I have recently split my database and added a password to the back end. I am now trying to re-link the tables as I have seen in other threads, but when I do this I am not prompted for the password I just get the message 'Not a valid password'
I must obviously be doing something wrong, can anyone help?
On the OnLoad event of a form, is it possible for the program to traverse or go through every single record (maybe with a while loop)?? If so, please send me the exact syntax.
Also, I want to update the tables on the back end. Is it possible to this in the be file? Where specifically would I have to put the code?
I need to know is there any specific code that would establish link for tables from Access BE?
I know it using Get External Data...Link Tables. Even though they are in other db but it leads to increase heavy size of main db. I want no table objects (except system tables) to be displayed in main db and only link tables once main db activates and should no table remain exists in FE after closing.
There should be some way to establish connectivity of tables from Access BE at the time of opening main db . This will help a ton to reduce the size of main db and its zip file can be copied even in a 1.44 mb floppy.
I heard something about shell but exactly I don't know how to do it.
Using an example:I have three tables; tbl_weight , tbl_height , tbl_bmi...How do I make tbl_bmi automatically use the weight and height values (height/ weight) to determine the tbl_bmi values? Is there a way to store code behind the tables as if I was in MS excel?
I am close to finishing a new database. In this database I have some VBA code that does a bunch of stuff, one of those things is to check if a temp table exists, and if yes then it will delete it.
Once finished this database will be made available to a range of people via Access Runtime 2010. I'm just wondering will the VBA code that deletes a table work in a Runtime environment?
I guess I should also ask if a save import process will also run via Runtime.just need to make sure that the users that need to do this code have full access if its required.
I searched and couldn't find anything on this specific issue.
I'm on the verge of designing a pretty big database and I've run into what may become a bit of a problem. There will probably be several backends in different locations. Should another backend ever be created or if the location for one changes, the user can use a form to refresh the links to the tables on that specific database.
The way I've done this so far is by having a piece of code that checks the tables for a connection string. If the table has a connection string, its a linked table, so the link gets deleted and replaced with the new link. Well this will no long work since there will be several backends and only 1 of them may need its tables relinked and using that code will delete all the table links, including the good ones.
Is there a way to make 'DoCmd.TransferDatabase' overwrite table names instead of giving the duplicate tables a number suffix? I think that doing this would be easier than retrieving the table names from the new backend and comparing them with the linked table names in the frontend so the old links could then be deleted.
I found 2 examples of code to refresh my attached table link to sharepoint lists.
I have a scheduled task open my Access 2010 db and an autoexec macro runs and closes the db.
My problem is my tables disconnect from sharepoint 2010 and the update fails.
I added the code I found to a module and added a line in my macro to run the code. Now I cannot get the code to work.
Am I at least on the right track? I just want to know before I spend many hours getting this code to work.
These are the two locations of code I found.
[URL]
I think part of my problem is that I have a regular table that I add a txt file to that is not linked to sharepoint so I need to exclude it from the code.
I have two tables in my Access database. Table 1 has three columns, First Name, Last Name and Phone Number. Table 2 has just 2 columns, First Name and Last Name. What I would like to do is write a VBA macro to consolidate Table 2 into Table 1 and insure any duplicate First Name-Last Name combination is removed.
Table1
Code: F.Name L.Name Tel.N. John Smith 12345 Larry Miller 12344 Tony Woods 12333
Table2
Code: F.Name L.Name Albert Black Larry Miller John Bush
Table1 Post-Macro
Code: F.Name L.Name Tel.N. John Smith 12345 Larry Miller 12344 Tony Woods 12333 Albert Black John Bush
I'm trying to import a few tables from a FoxPro database into an Access Database using VBA code. I know I have done it before and I remember struggling with the format last time.
Iam using the following code for inserting the values from access form in to the access database table ITEMS, but iam getting compile errors, may i know where iam going wrong in the code.
Also help me in updating, deleting and viewing of records from database table ITEMS to the form when i run the program.
Following is my code :
Private Sub ADD_Click()
On Error GoTo Err_ADD_Click
Dim cn As ADODB.Connection Dim rs As ADODB.Recordset
Set cn = CurrentProject.AccessConnection
'Create an instance of the ADO Recordset class, and 'set its properties
Set rs = New ADODB.Recordset With rs Set .ActiveConnection = cn .Source = "SELECT * FROM ITEMS" .LockType = adLockOptimistic .CursorType = adOpenKeyset .CursorLocation = adUseServer .Open End With
'Set the form's Recordset property to the ADO recordset
Works great, but when I hit the number "3", (3 times in row) it will let me into the form. I want it to not let me in IF I don't know the password.
Where did I go wrong?
Private Sub Form_Load() Dim pw As Variant
If InputBox("What is the password?", "Password") = "1" Then Else MsgBox "Invalid Password", vbCritical, "Sorry Charlie" DoCmd.Close If InputBox("What is the password?", "Password") = "2" Then Else MsgBox "Invalid Password", vbCritical, "Sorry Charlie" DoCmd.Close End If End If
I protect my code from people being able to read it by setting a password on the code from Tools > Properties, selecting the Protection tab and entering a password, and clicking "Lock Project"
Is there a way to write code that will remove that Lock Project check and check it back on?
I've looked through the Application.SetOption command and it doesn't seem to be one of the choices. It would be very helpful if someone knew how to do this.