>I'm using VFP with MySQL database.
>
>I know how to open table from other database but still in the same server:
>
>select * from office1.invoice
>
>
>but how to open table from other server, eg, server: sony, database: office1, table: invoice, password: mypass
>
>thanks for the help
You'll have to create a second connection.
If you create a FEDERATED table in the first server, the connection is managed by MySQL itself (see
http://dev.mysql.com/doc/refman/5.0/en/federated-storage-engine.html). But I think the simpler alternative would be to create a second VFP connection in your client machine for the second server.
The first scenario allows you to join tables immediately at the statement level. For instance,
SELECT atfirst.* FROM office1.invoice atfirst INNER JOIN office1.sony_invoice atsecond ON some_condition
(note that the federated table is a table in your office1 database, similar to a regular remote connection in a VFP database).
Using a second connection in VFP will free you from changing the structure of your MySQL database and the need to keep a vigilant eye on any table changes that may occur. If you want to join tables from the two servers, you'll have to create separate VFP cursors and join them locally.
----------------------------------
António Tavares Lopes