PC Review


Reply
Thread Tools Rate Thread

Copy table form BE database to BE database

 
 
Cesar
Guest
Posts: n/a
 
      18th Aug 2008
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?
 
Reply With Quote
 
 
 
 
Tony Toews [MVP]
Guest
Posts: n/a
 
      18th Aug 2008
Cesar <(E-Mail Removed)> wrote:

>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/
 
Reply With Quote
 
Cesar
Guest
Posts: n/a
 
      19th Aug 2008
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

"Tony Toews [MVP]" wrote:

> Cesar <(E-Mail Removed)> wrote:
>
> >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/
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy table from open database to a closed database RW Microsoft Access VBA Modules 6 2nd Dec 2007 12:40 AM
Link form another database table into current database Anna Microsoft Access Forms 2 16th Aug 2006 08:57 PM
copy table from one database to another reidarT Microsoft Access Form Coding 1 25th Dec 2005 12:10 PM
Failure to import a table to other database & make a copy in the same database Ray Microsoft Access 0 2nd Oct 2004 09:33 AM
Copy a Table from 1 Database to Another Tiago Filipe Microsoft Access Queries 0 16th Nov 2003 10:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:56 PM.