Linked Tables - Refreshing DATA

J

Jeff K

I'm having a problem with a database I just split. The front-end linked tables are not showing what is actually in the backend database table

I am using a direct ADO connection to the backend to insert records into the backend table. Then when I requery or reset the recordsource for a form to show the new record, the record does not appear. If I wait a few seconds to do the requery, the record will show up

If I do the insert using the CurrentProject.Connection (accessing the linked table instead of the backend table directly) the new record shows up fine, but I want to do it using an existing ADO connection to the backend because the update runs much faster

Is there a refresh I can do on the linked data to make sure it always shows what's in the backend? I tried Currentdb.Tabledefs.Referesh and Currentdb.TableDefs("TableName").RefreshLink but neither helped and I don't think these refresh methods are for refreshing the data anyway

Any ideas
Thanks
Jef
 
6

'69 Camaro

Hi, Scott.

"Refresh" and "requery" are two different things. Refreshing the data only
updates the data that already exists on your form. Refreshing doesn't
display any new records or updates made by other users or remove deleted
records. If you want to display the latest version of your data, then you
need to requery the table.

For an example of the code to connect to SQL Server tables via ADO (avoiding
the linked tables, as Jeff is doing), check this Microsoft's Knowledge Base
article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;281998&Product=acc

HTH.
Gunny

Coming soon:
For your Microsoft Access, database development and maintenance needs, see:
http://www.softomagixly.com


Scott Lyon said:
I'm having a very similar issue (I've got SQL linked tables, and I want a
way to force a refresh of the data displayed on Access forms - I may do it
via a "Refresh" button on my form, or I might call it via a Timer control,
but either way, I still need to figure out how to do the back-end code
itself).

Can anyone help?


Thanks!

-Scott

Jeff K said:
I'm having a problem with a database I just split. The front-end linked
tables are not showing what is actually in the backend database table.
I am using a direct ADO connection to the backend to insert records into
the backend table. Then when I requery or reset the recordsource for a form
to show the new record, the record does not appear. If I wait a few seconds
to do the requery, the record will show up.
If I do the insert using the CurrentProject.Connection (accessing the
linked table instead of the backend table directly) the new record shows up
fine, but I want to do it using an existing ADO connection to the backend
because the update runs much faster.
Is there a refresh I can do on the linked data to make sure it always
shows what's in the backend? I tried Currentdb.Tabledefs.Referesh and
Currentdb.TableDefs("TableName").RefreshLink but neither helped and I don't
think these refresh methods are for refreshing the data anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top