Tables :: Update ODBC Linked Tables On MS Access?
Apr 30, 2015How to Update ODBC linked tables on ms access?
View RepliesHow to Update ODBC linked tables on ms access?
View RepliesI have linked tables from SQL Server using ODBC connection that their location never changes. I have used certain fields of those tables to create queries and make table queries to derive to the information I needed.
On these tables on SQL Server, there is new data added daily. Every day, midnight, there's new data records added of whatever transactions took place in that working day. how often do I need to refresh linked tables in this case to get the latest data added. I mean, once I am linked, the make table query using those defined fields, would it get the latest data added by default when the query is executed, or I must refresh linked tables using Linked Table Manager and then run make table query.
Also, if I want the access to automatically refresh linked tables, can I use the following code? I have added this code, and executing it through a button, but I don't see anything happen, the database becomes inactive for couple seconds (I guess while it is updating) but I don't know is it updating the tables for sure or not, though I am not receiving any error when executing the code through the button.
Function RefreshLinkedTables()
Dim tdf As TableDef
For Each tdf In CurrentDb.TableDefs
If Len(tdf.Connect) > 0 Then
tdf.RefreshLink
End If
Next td
End Function
My problem is best explained by example;
In Access Database A, I have some linked ODBC tables (to an SQL Server database) and some local tables.
In Access Database B, I have a front end which links to all the tables in Access Database A.
The problem is, when I try to link the tables in B, I cannot see the ODBC tables linked in A. Is there any reason why not? 'Why not link Access Database B to the SQL Server tables directly?', you may ask. Well, there is an answer to that but it is quite difficult to explain. I assure you there is one. :p
Hi!
I'll cut right down to it: I have an ODBC connection to a (SQL Server) test database on my development machine that is identical to the live database to which a (different) ODBC connection exists on the PC where this Access application is to be deployed. The problem is that when I deploy, there are some tables that have to be updates, because they still point to my test database. The other tables look like they use the default database for that user.
I used to be able to just copy the Access application and it would work without having to update any linked tables.
To clarify, the tables that work without a problem look like this in the Linked Table Manager:
t_mytable (DSN=odbc;)
And the problem tables have this:
t_mytable2 (DSN=odbc;DATABASE=my_test_db)
I don't seem to be able to clear that DATABASE= thing up. Can anybody tell me how this works?
If this question is overly trivial, I apologize.
Hi,
I have a lot data to append to ODBC linked table in MS Access. I want to know that which way is faster to append the records.
if I append the data into ODBC linked table,
1) create the one query (append) to insert the records into ODBC linked table
2) use the VBA code (DAO/ADO) to insert the records into ODBC linked table
which way is rather faster?
My tables are sybase linked tables to my Access front end. I get this error whenever i click away from my mainform while my not-null fields (textboxes) have not been entered. So, i would like to put an error message "somewhere" that tells the user to fill in the necessary fields and highlight the necessary textboxes in red, instead of this scary ODBC message
http://img82.imageshack.us/img82/6829/error0el.png :eek: :eek:
When i put my error handling in the afterUpdate or afterInsert Event. I still get the above error msg instead of my msgbox.
Where do i put this message? or should be question be, "what the proper way to handle this intimidating error? :)
Here's my error handling:
On Error GoTo Err_Form_AfterInsert
'do something
Exit_Form_AfterInsert:
Exit Sub
Err_Form_AfterInsert:
MsgBox Err.Description, vbExclamation, "Please enter the Project Name, Project Leader Initials, Main User and Status Code" & Err.Number
Me!Combo67.BackColor = "red"
Me!Combo65.BackColor = "red"
Me![Project Name].BackColor = "red"
Me![Project Leader Initials Combo].BackColor = "red"
Resume Exit_Form_AfterInsert
Thanks in advance for your help :D
Our master database has linked tables with ODBC to our SQL database and linked tables to another access database. On the computer i'm running this from a System DSN data source has been created to connect to our SQL database.
The problem I'm having is when I run Macros to kick off Queries, there seems to be some kind of timeout issue and its not consistant. Sometimes in Access after a hour or two, the ODBC links somehow just fails. I have to go up to the menu and go to 'Get External Data' and then 'Link Tables' and relink the ODBC DSN connection. I make sure to hit save password and the end but that doesn't seem to do much. This also happens sometimes when I close and reopen the database.
But it seems erratic, sometimes it can stay up for hours but sometimes just a few mins. Sometimes I can close the Access database and reopen without losing connection. Being so erratic, this makes it very hard for me to run batch files nightly to kick off Macros. Is there some kind of inactivty timer for DSNs? Or maybe with the SQL database itself? Or is the way i'm restablishing the ODBC connection wrong ?
Using access 2007 (and tried 2003) I have a linked ODBC table which is using an ORACLE driver. If I query the table directly through ORACLE/SQL for a particular 'job number' I get the following results:
18598979 3 06-DEC-13 10:10
18598979 0 03-DEC-13 10:34
18598979 1 03-DEC-13 10:34
18598979 2 06-DEC-13 08:20
However when I link the table through access and view the same job number within the table (not even using a query) it displays the following:
18598979 3 06/12/2013 10:10:00
18598979 3 06/12/2013 10:10:00
18598979 3 06/12/2013 10:10:00
18598979 3 06/12/2013 10:10:00
As you can see it only displays the MAX date/time and associated data from the 4 available records, duplicating the record. I've checked the field formats and they all look fine. It does the same if I pull through the table on it's own or with other linked tables.
Hello,
The scenario. Two PC's, one older than the other, both running Windows 2000 (SP4) and Office 2000 (SP3). I use Access as a front end to a MySQL database, connections are made using ODBC.
I recently altered the structure of a table and attempted to re-link the table in access using the Linked Table Manager on the new PC. All that happened was the hourglass came on and never went away. I tried to do this on the old PC and it worked fine first time.
Any ideas why I can't get it to work on my new PC? It's quite important as I won't have the old PC with me much longer :-(
Regards,
Matt.
Hello, this is my first post (anywhere ever)!:eek:
While I have lots of Access programming experience over the years I have broken new ground this week and am in unchartered territory and need help please!
In the organization I am working for (as Procurement Manger), we use AMMS (by Microwest) for work order generation and inventory management, etc. I have been able to import into Access the tables of interest from this SQL-based package. The problem is that I need to share the tables (via nice front end forms/queries) with about 20-30 people in the field.
I don't know much about ODBC but the administrator of AMMS was kind enough to give me access to the AMMS database tables via ODBC and I, personally have access to read the table data but none of the other people in the field can access these tables due to security rights.
So, what I have done is I created MS Access tables for each of the 4 AMMS tables of interest and I run code that runs delete and append queries on each table. I then have a separate public db that the field people access with all the queries and forms but only links to the Master db containing the 4 Access tables derived from the ODBC tables. This works ok but there are issues:
1) if any field people are on the Public db, the code to import the ODBC table data loops and does not complete the delete/append cycle on one or more of the tables. I can only refresh the table data when nobody is connected to the db - impractical.:(
2) the ODBC tables are rather large - one is over 38,000 records and it takes several minutes to run the delete/append queries.:mad:
3) When I created the Master db it was some 83MB. After running the delete/append queries it is some 179MB and appears to increase in size every time I run the delete/append code. When I run "compact db" it stops running after a short time. Does nothing but create a new file (db1.mdb) of the same huge size as the Master.:confused:
I suspect the most graceful solution would be to give each user rights to the ODBC tables from AMMS in Access. In this case, I wouldn't have to run delete/append queries and the data would always be in relative real time subject to the refresh timer. Unfortunately, due to AMMS licensing restrictions, this is not doable.
I have tried to search the internet for guidance but no luck. This forum appears to be an excellent opportunity to get expert advice on this particular issue. I thank you for your thoughts and guidance.
I have developed a Microsoft Access 2010 database for my client and the database is split with Front-end/Back-end, the Back-end and the database is shared on Network, The client operating system and applications for all users are hosted and consistent and the service is delivered over Citrix.
The database some times corrupt the tables record and give a permanent #Delete Error, I have attached one of the database table and the screenshot of the error,
I have a split database.(Access 2010).Three of the linked tables are Appointments, Appointments_OLD, Appointments_NEW.
I want to use vba to rename Appointments as Appointments_OLD (replacing the current one) and to rename Appointments_NEW as Appointments (replacing the current one)
I have used:
'replace Appointments_OLD by Appointments, replace Appointments by Appointments_NEW
DoCmd.Rename "Appointments_OLD", acTable, "Appointments"
DoCmd.CopyObject , "Appointments", acTable, , "Appointments_NEW"
Unfortunately this just made Appointments and Appointments_NEW clones of one another - changes in one automatically occur in the other.
What I actually want to do is to swap the names round in the backend database while maintaining the right links to the frontend.
Is this possible using vba in the frontend?
I've been creating a new Access application and I've run into an issue. The form I created has 2 subforms on it. The data is stored on 3 different tables related by the RMAID. The data gathered from this form needs to go into our MRP application. I have linked the necessary MRP tables to my access application. How do I get the date from the form to the tables in our MRP application? The data needs to go to 3 tables from the MRP application. Do I create an append query that's run after the user completes entering the data on the form? Thanks for any help
View 1 Replies View RelatedHi,
I want to import into an MDB table a csv file.
I'm trying to use the bulk copy table.
my function is:
SQL = "SELECT * INTO [my_table] FROM [ODBC;Driver=Micrsoft text driver (*.txt; *csv) ;Dbq=c:\;Extensions=asc,csv,tab,txt;].table.csv"
db.OpenEx( "Driver=Microsoft Access Driver .mdb);DBQ=c:\access.mdb;", CDatabase::noOdbcDialog );
db.ExecuteSQL( SQL );
when i run this function i get an error : "You cannot use ODBC to import from, export to, or link an external Microsoft Jet or ISAM database table to your database"
when i try to import in the same way a dbf file (insted the csv file) with VFP it's working well.
what seems to be the problem? how can i fix it? or if some one know how can i import a large csv file into access DB in an efficient diffrent way?
thanks ishay
I have set up a table (A) that is linked to another table(B) in my database. This linked table (A) is then used in a number of queries. When the data in the original table (A) is updated it does update the data in the linked table (B) as it should. However, when I run the queries they do not bring up any records. It seems that they are not looking at an updated version of the linked table (A) because if I rebuild the query it finds the records as it should. Any advice on this would be very gratefully received.
View 1 Replies View RelatedHi all
I need some code to refresh/update linked tables to a data base in the same folder on startup. Any idea how I can do this??
Thanks
Damo
I am currently using Microsoft Access 2010 32bit, and have one database acting as parent, with a second linked database as a client for people to work with, and the parent database has tables imported from Sage V21 via ODBC. I have used the following code as specified in other examples as follows:
Code:
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=MyDNSMachineName;UID=MyUID;PWD=MyPassword;LANGUAGE=us_english;" & "DATABASE=pubs", acTable, "INVOICE", "INVOICE"
one of the tables has 10k records in it, it only transfers 77 records. After manually attempting an import via the ODBC wizard it finally lets me access all 10k records.I wish to have a single button click delete and import fresh tables without worrying if all the data is coming across.Also, when manually adding a table, I am usually asked by the wizard to specify an index, but with the code above, I am not offered that option and the tables come across with no index. I am led to believe that having tables that link to each other without an index is bad, so how do I ensure an index is created?
I have an access database with a linked table to an Excel spreadsheet. I have a form based on the linked table so the presentation of the Excel date is better. The spreadsheet is used by other staff in my office to record sales which I need to register with an external organisation. What I want to do is update the spreadsheet with the registration date from my access form rather than going back into excel to do it.
View 2 Replies View RelatedHi.
I'm about to move to a back end / front end system, from a single database file. Before I do so, I want to make sure I have all bases covered so to speak.
My back end file will reside on a server. I am aware that path names are sometimes changed by network administrators without warning.
From tests, I notice that, if the path to the back end can't be found, one cannot open the front end database file at all (Access 2003).
My question is: if my back end file gets moved, or the path changed, how can I get into my front end file to update the linked tables.
Many thanks in advance.
Mat.
I'm using Access and Excel 2007.... I know how to import an Excel spreadsheet as a table.
I have several supplier price lists in Excel. I want to keep my vendor price lists up to date.
When one of my vendors tell me that a price has changed on a particular item, I figure that I could have a form that I could use to enter the changes.
I believe the form would look like:
Field: "Vendor" (drop down list to choose from. Name of the Supplier price lists) Required.
Field: "OEM" (Key Field found in each table) Required.
Field: "Brand" (Field found in each table) Not required.
Field: "Price" (Field found in each table) Required.
OEM would be the unique key field.
If I enter the Vendor name and then the OEM number it would show if there is already that number in the Vendor price list and I could make changes. Or I could enter new data in that vendor price list.
Hi,
This may be a simple question, but I'd like to reassure myself, so here goes. I have a database which is used to produce a pile of reports, and the tables are linked to a second database. I now need to update the reports, and add new data for this year. But the second database is password protected, and yep, I don't know that password. (I'm taking over this project from someone who left 3 years ago - I haven't just forgotten the password honest!)
Is it ok to import new data to the second database, and still carry on producing reports?
What if I want to change the properties in one of my linked tables? Can I delete the link, change the property, and then reapply the link?
Thanks for your advice,
Antro.
Hi, There seem to be a serious bug in Access 97, and I want to know if anyone has encountered this before.
I tried to describe the problem as best as I can, I also included a flash video to describe everything, here it is:
http://naderchehab.googlepages.com/linkedtablebug.swf (~1 MB)
My database has two tables:
- dbo_InventoryLocation which is linking to SQL Server 2000 via ODBC which contains inventory quantities for each product, and
- tblPRODUCTS_BUSINESS which is linking to another access database on the network and contains product information
(item number, title, description, and a field called "InvCategory" which describes item categories). I wrote a very simple query that links these two tables together:
SELECT tblPRODUCTS_BUSINESS.InvCategory, dbo_InventoryLocation.ItemNumber
FROM tblPRODUCTS_BUSINESS INNER JOIN dbo_InventoryLocation
ON tblPRODUCTS_BUSINESS.Item_Number = dbo_InventoryLocation.ItemNumber
GROUP BY tblPRODUCTS_BUSINESS.InvCategory, dbo_InventoryLocation.ItemNumber
ORDER BY tblPRODUCTS_BUSINESS.InvCategory;
The query really doesn't matter, it's just a test. Now here's the weird part:
when I execute this query, and I scroll down to a specific category and count the number of items in that category, I see about 50 of them.
But if I specify that category as a criteria, I see more than 200!
I also noticed that this problem does not happen when I use non-linked tables.
I hope anyone has an idea what that problem might be, and I hope there is a way around it.
Thanks,
Nader
i have imported 5 excel files and linked to a query named stock.i have linked the code,description and quantity from each table (ms excel imported) to stock.
the problem is not all the codes available in the tables r available in stock.there r
more than 25000 codes but only 2614 r listed in stock.i dunno whether its the problem with the way i have linked.so if u can help me with the problem i will be really thankful.
5 excel sheets contains the code,description and qty of 5 shops.in the query stock contains 1st column-id,2nd column-code,3rd column-description and 4th,5th,6th,7th,8th column the qty from 5 excel sheets respectively.i have given the images below of 1st shop(similarly 2,3,4 and 5 r made).the image of relationship is also given.so pls help me.
Hi,
I have two databases in Access.
One of the database acts as backend i.e it has only tables including some Linked Tables(which are linked to some third database)
Other database is an executable in which all the tables are linked to the bakend database.
I am not able to link to the linked tables in the backed database. Is there a way of doing that?
I have split database (B/E is in the SharePoint library, F/E has users on a local PCs). Sometimes, when I update/add data (does not matter if it is via form or directly in the table) it looks OK, but when I re-open the database, the data are gone.
Problem is that I cannot catch the moment when data were not saved (sometimes data are saved, sometimes not). I can point out this: if I re-enter the missing data, primary key continues subsequently, it looks like the data have never been entered. I tried to use script
Code:
If Me.Dirty Then Me.Dirty = False
on "On Close" form event, does not work.
B/E is linked by VBA code and it looks OK (no error, Link Manager shows correct path). I suspect interrupted connetion to the SharePoint but I don't know how to check it. I implemented VBA script co keep open connection to the SP but the issue persists.
We are sharing an Access 2003 database amongst two departments that contains twelve (12) tables that are SQL Server linked tables. Nine (9) of the tables work just fine for people in both departments. Three (3) of the tables cannot be opened until the user refreshes the link(s) using their ODBC DSN.
We do not understand why nine of the tables work without issue but three will not.
Has anyone ever run into this issue before? Does anyone have any ideas on how to resolve this issue?
Thanks