Page 1 of 2

Embedded: How?

Posted: Sat 05 Feb 2005 12:03
by Taras Kopets
Please tell me how to connect to embedded server, I always get Access violation.. using C++ Builder 6. Could anyone tell me step by step how to do it.
Thanks in advance

Posted: Mon 07 Feb 2005 09:53
by Ikar
Please see Demos/Embedded folder.

PS: What MyDAC and MySQL Embedded Server versions do you use?

Posted: Mon 24 Oct 2005 03:43
by ManUtd
Do you have a "Step by Step" help/guide/tutorial" on how to setup the TMyEmbConnection component please ?

Posted: Mon 24 Oct 2005 12:57
by Ikar

Posted: Tue 25 Oct 2005 04:04
by ManUtd
Just wonder using the Embedded Server how do you make use of the data without copying into the main MySQL Server ?
Note: I assume the PC running the Embedded Server application has no MySQL Server installed.

Posted: Tue 25 Oct 2005 09:45
by Ikar
> without copying into the main MySQL Server ?
Do you mean "from the main MySQL Server "? All tables and data stored in MyScript.

Posted: Wed 26 Oct 2005 01:12
by ManUtd
I would like to make an update log in my Embedded Server and use this update log to update the main MySQL Server.

Can you tell me how do I turn on the Embedded Server's updat log please ?

Posted: Thu 27 Oct 2005 06:24
by Ikar
You can use MyEmbConnection.Params. You can read details about Embedded server parameters in MySQL reference manual.

Posted: Thu 10 Nov 2005 22:59
by ManUtd
Is there a standard way/steps to make merge replication/synchronizations between MySQL Server and the embedded server in my application ?

Posted: Fri 11 Nov 2005 15:20
by Ikar
MySQL Embedded server does not support replication. So, you should copy data manually.

Posted: Mon 14 Nov 2005 22:46
by ManUtd
If the MySQL Embedded Server does not support replication, how do I synchronize the database with more than 1 Embedded Server?

For example, if I have 5 sales persons their notebook have Embedded Server, go to the site and modified the database. We need to synchronize the database one by one when they're back to office.

After the last sales person synchronized the database, the database server got all the updated data.

Then the 5 notebook need to synchronize again to get the final database state.

Posted: Tue 15 Nov 2005 09:22
by Ikar
We advise to use timestamp fields to detect changes in row.
To synchronize data use two TMyQuery (MyQuerySrc and MyQueryDst), connected to Embedded and office servers.
In MyQuerySrc execute SELECT * FROM table WHERE c_timestamp > LastSyncDate.
In MyQueryDst execute SELECT * FROM table LIMIT 0, 0
After that just copy data from MyQuerySrc to MyQueryDst.

Posted: Thu 17 Nov 2005 06:27
by ManUtd
Hi,

I think yours is the solution to my problem.
BUT could you send me a very simple project that can work for a single table please ?

Especially the last step: how do I copy the data from MyQuerySrc to MyQueryDst ?

Posted: Thu 17 Nov 2005 10:24
by Ikar
> BUT could you send me a very simple project that can work for a single table please ?

We don't have samples other than included in the installation package.


> Especially the last step: how do I copy the data from MyQuerySrc to MyQueryDst ?

Use something like this

Code: Select all

while not MyQuerySrc.eof do begin
  MyQueryDst.Append;
  for i := 0 to MyQueryDst.Fields.Count - 1 do
    MyQueryDst.Fields[i].Value := MyQuerySrc.Fields[i].Value;
  MyQueryDst.Post;
  MyQuerySrc.Next;
end;

Posted: Wed 30 Nov 2005 08:12
by xchaotic
ManUtd: have you got the project working already?
This is a great feature to have.
My only concern is that time synchronisation is of essence in such a scenario.
I've seen many computers having wrong date, for instance everytime a BIOS is updated or reset it goes back to the bios release date.
So I think it might make sense to incorporate time server synchronisation and another important factor: timezones.
Quite often the system clock is set to local timezone, if the two laptops connect with the same db via Internet, which is imho easy you could force an update of every field to old values if the date or even hour is set to later than the server's.
I think it's fairly reasonable to consider using tags. Every row has primary key, Id field or sth like that, so it should be sufficent to store the list in an SQL table for instance (it could be further optimised to include the type of operation, previous_data and the timestamp or the timestamp can be included in the main table) and only then use the timestamps to update the main db.
The reverse operation should be different as other laptops/nodes might have updated other fields, but tagging on both sides would probably be beneficial.
I might be wrong though as I am a mere beginner in the field, the timestamps might suffice.