Copy table form BE database to BE database

C

Cesar

I developed a program that will be deployed in Latin America that has
multiple language capabilities.
I stored the captions in a table in the BE database for each language
(English, spanish, and Portuguese).
To create a new language (there is interest to use the application in Europe
too), I need to create a new table (TableNew) from one of the existing
languages (TableRef) to translate.
To do this I wrote the code:

DoCmd.TransferDatabase acExport, "Microsoft Access", _
BEPath & "Myfile.mdb", acTable, _
TableRef, TableNew, False

CurrentDb.TableDefs(TableNew).RefreshLink

The first line is suposed to create the copy, but it only places a link to
TableRef named TableNew, instead of creating an entirely new table.
Since the table does not exist, the refreshlink action does not work either.
Ideas?
 
T

Tony Toews [MVP]

Cesar said:
I developed a program that will be deployed in Latin America that has
multiple language capabilities.
I stored the captions in a table in the BE database for each language
(English, spanish, and Portuguese).
To create a new language (there is interest to use the application in Europe
too), I need to create a new table (TableNew) from one of the existing
languages (TableRef) to translate.
To do this I wrote the code:

DoCmd.TransferDatabase acExport, "Microsoft Access", _
BEPath & "Myfile.mdb", acTable, _
TableRef, TableNew, False

CurrentDb.TableDefs(TableNew).RefreshLink

The first line is suposed to create the copy, but it only places a link to
TableRef named TableNew, instead of creating an entirely new table.
Since the table does not exist, the refreshlink action does not work either.

1) I'd suggest using one table for all languages with a language code
as part of the index to the record.

2) A performance trick that someone who faced the same problem a
number of years ago was to read all the relevant caption records for a
form updating the captions as you went down the recordset. Rather
than reading a caption, looking up the value of the data in the table
and repeating. Much less index lookups.

3) Why aren't these tables in the FE? The user would never update
these tables, right? Just you the application developer.

4) I can't answer why the docmd.transferdatabase doesn't work as I've
never used that. I'd likely use a MakeTable query with the IN clause
instead.

5) Once you've figured out the docmd.transferdatabase or another
solution then the refreshlink should then work.

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/
 
C

Cesar

Tony,
Actually after I posted this message I started to experience with a single
table where each language is a field. I was able to add a field to an
existing table in the BE, what solves my problem.
Regarding the captions, I call a sub to load all the captions OnOpen,
storing messages, etx. as string variables that I use througout each moduke.
Thanks,
Cesar
 

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