Re: Relink question



Thanks for the reply. When you say I should open a database variable against the backend, would that be something like this?

Dim db as DAO.Database
Set db = CurrentDatabase()

or for the recordset:

Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("tblMain", dbOpenDynaset)
(where tblMain is the first linked table)

If so, in either case would this be in the relinking code, and would I close the recordset at the end of the relinking code? If not, where have I missed the boat?

I sort of get what you are saying (although I have to say I don't understand the "why"), but not enough to implement it with any confidence.


"Tony Toews [MVP]" <ttoews@xxxxxxxxxxxxxxx> wrote in message news:pr87i4turpnnp0ptv5jopcjfohfn2dnq54@xxxxxxxxxx
"BruceM" <bamoob@xxxxxxxxxxxxxxxx> wrote:

Thanks again, Graham.. It will be some time before I can sort this out. In
particular it seems I need to use something like GetPrivateProfileString to
read from the ini file,

And the equivalent to write to the INI file once you've found the
correct BE.

Or you could use the registry. I initially chose to use INI files
because I figured that it would be easier for the users if they ever
had to manually update the file. But in over ten years I don't think
I've ever had the need.

I think I'll look for a way to
relink all tables every time and leave it at that for now.

Note that for best performance you should do either one of the
following:

1) Open a database variable against the backend
or
2) Once you've relinked the first table open a recordset variable
against that table and continue relinking all the other tables.

This will make a huge difference in performance when someone else is
already in the FE linked to the BE in question.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

.



Relevant Pages

  • Re: Relink question
    ... What Tony means is that when you create a linked table, part of the process involves the file system creating a reference to the backend database. ... If so, in either case would this be in the relinking code, and would I close the recordset at the end of the relinking code? ... Tony Toews, Microsoft Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: Relink question
    ... This contains one record for each backend. ... The frontend also contains a query named USysCompareLinkedTables: ... This lists only the "broken" tables which require relinking. ... Graham Mandeno [Access MVP] ...
    (microsoft.public.access.formscoding)
  • Data Conversion Error Adding Field to Backend
    ... backend using code in the front end. ... Function fGetLinkPath(strTable As String) As String ... Dim dbs As Database, stPath As String ... Function UpdateTableFieldDefns() As Boolean ...
    (microsoft.public.access.devtoolkits)
  • Re: Dont link to system tables in backend
    ... Public Function RelinkToCurDir(PassedBEFile As String, ... Dim wsBACK As DAO.Workspace ... 'and are deleted each time as each backend file is linked. ... Dim rsLOCALFlag As Boolean ...
    (comp.databases.ms-access)
  • RE: Import Excel file into table reference by DAO
    ... follow to relink the table to the new backend. ... That should put the data in the backend database ... Dim dbAccess As DAO.Database ... Dim fldAddr1 As DAO.Field ...
    (microsoft.public.access.modulesdaovba)

Loading