Discussion:
xHarbour and OTC Mediator for MySql
(too old to reply)
Spiro
2007-12-20 10:54:34 UTC
Permalink
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I
run their sample xHarbour connection, it works. My altered code (1 line
added) doesn't. I have only added this line

USE PRT

and get error SRV/1402 (PRT: no such table). The table exists in the
MySql database, Mediator is running, the connection works, but no PRT
table is recognized. Anyone played with Mediator and xHarbour to help me?

***********************************
* Minimal Clipper/Mediator program

#include "mediator.ch" && optional if not using Mediator macros

request medntx && mandatory

RDDSETDEFAULT("MEDNTX") && set default data source to MEDNTX RDD driver
&& OR
*RDDSETDEFAULT("MEDCDX") && set default data source to MEDCDX RDD driver


USE PRT

? "Connected to Mediator server"

* Any database operations coming here will operate on
* database server instead of DBF files!

WAIT

? "Disconnecting from Mediator - Bye"
Massimo Belgrano
2007-12-20 14:25:46 UTC
Permalink
Post by Spiro
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I
run their sample xHarbour connection, it works. My altered code (1 line
added) doesn't. I have only added this line
USE PRT
and get error SRV/1402 (PRT: no such table). The table exists in the
MySql database, Mediator is running, the connection works, but no PRT
table is recognized. Anyone played with Mediator and xHarbour to help me?
***********************************
* Minimal Clipper/Mediator program
#include "mediator.ch" && optional if not using Mediator macros
request medntx && mandatory
RDDSETDEFAULT("MEDNTX") && set default data source to MEDNTX RDD driver
&& OR
*RDDSETDEFAULT("MEDCDX") && set default data source to MEDCDX RDD driver
USE PRT
? "Connected to Mediator server"
* Any database operations coming here will operate on
* database server instead of DBF files!
WAIT
? "Disconnecting from Mediator - Bye"
DBCREATE(<cDatabase>, <aStruct>, [<cDriver>])

aDbf := {}
AADD(aDbf, { "Name", "C", 25, 0 })
AADD(aDbf, { "Address", "C", 1024, 0 })
AADD(aDbf, { "Phone", "N", 13, 0 })
DBCREATE("PRT", aDbf, "MEDNTX")
USE
Spiro
2007-12-20 14:41:28 UTC
Permalink
Post by Massimo Belgrano
Post by Spiro
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I
run their sample xHarbour connection, it works. My altered code (1 line
added) doesn't. I have only added this line
USE PRT
and get error SRV/1402 (PRT: no such table). The table exists in the
MySql database, Mediator is running, the connection works, but no PRT
table is recognized. Anyone played with Mediator and xHarbour to help me?
***********************************
* Minimal Clipper/Mediator program
#include "mediator.ch" && optional if not using Mediator macros
request medntx && mandatory
RDDSETDEFAULT("MEDNTX") && set default data source to MEDNTX RDD driver
&& OR
*RDDSETDEFAULT("MEDCDX") && set default data source to MEDCDX RDD driver
USE PRT
? "Connected to Mediator server"
* Any database operations coming here will operate on
* database server instead of DBF files!
WAIT
? "Disconnecting from Mediator - Bye"
DBCREATE(<cDatabase>, <aStruct>, [<cDriver>])
aDbf := {}
AADD(aDbf, { "Name", "C", 25, 0 })
AADD(aDbf, { "Address", "C", 1024, 0 })
AADD(aDbf, { "Phone", "N", 13, 0 })
DBCREATE("PRT", aDbf, "MEDNTX")
USE
Yes. Figured it already out. I didn't know it had to be tables in a
special Mediator data dictionary with RECNO and IS_DELETED fields. Now
it works. Anybody experience with 50-60 simultaneous users?
Jacek K.
2007-12-27 15:32:54 UTC
Permalink
Post by Spiro
Post by Massimo Belgrano
Post by Spiro
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I
run their sample xHarbour connection, it works. My altered code (1 line
added) doesn't. I have only added this line
USE PRT
and get error SRV/1402 (PRT: no such table). The table exists in the
MySql database, Mediator is running, the connection works, but no PRT
table is recognized. Anyone played with Mediator and xHarbour to help me?
***********************************
* Minimal Clipper/Mediator program
#include "mediator.ch" && optional if not using Mediator macros
request medntx && mandatory
RDDSETDEFAULT("MEDNTX") && set default data source to MEDNTX RDD driver
&& OR
*RDDSETDEFAULT("MEDCDX") && set default data source to MEDCDX RDD driver
USE PRT
? "Connected to Mediator server"
* Any database operations coming here will operate on
* database server instead of DBF files!
WAIT
? "Disconnecting from Mediator - Bye"
DBCREATE(<cDatabase>, <aStruct>, [<cDriver>])
aDbf := {}
AADD(aDbf, { "Name", "C", 25, 0 })
AADD(aDbf, { "Address", "C", 1024, 0 })
AADD(aDbf, { "Phone", "N", 13, 0 })
DBCREATE("PRT", aDbf, "MEDNTX")
USE
Yes. Figured it already out. I didn't know it had to be tables in a
special Mediator data dictionary with RECNO and IS_DELETED fields. Now
it works. Anybody experience with 50-60 simultaneous users?
I have client with about 13 computers in local network, server is not
very good, it fine working, locking record working property, all
system is ok, but if I executing query on server by use xSQL as
<query> for analyze great 1000000 rows in one tables with joins the
MySQL locking tables for time executing this query, and another users
must wait few seconds :(. This is problem is MySQL server but not in
mediator.

Jacek K.

Giuseppe Mastrangelo
2007-12-20 14:47:23 UTC
Permalink
The table must be created with dbcreate function and not with sql command.
Mediator simulte dbf and all table muste be create with xharbour command.
The read of table vicevera can be read with sql command.
Ciao Giuseppe.
Post by Spiro
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I run
their sample xHarbour connection, it works. My altered code (1 line added)
doesn't. I have only added this line
USE PRT
and get error SRV/1402 (PRT: no such table). The table exists in the MySql
database, Mediator is running, the connection works, but no PRT table is
recognized. Anyone played with Mediator and xHarbour to help me?
***********************************
* Minimal Clipper/Mediator program
#include "mediator.ch" && optional if not using Mediator macros
request medntx && mandatory
RDDSETDEFAULT("MEDNTX") && set default data source to MEDNTX RDD driver
&& OR
*RDDSETDEFAULT("MEDCDX") && set default data source to MEDCDX RDD driver
USE PRT
? "Connected to Mediator server"
* Any database operations coming here will operate on
* database server instead of DBF files!
WAIT
? "Disconnecting from Mediator - Bye"
Jacek
2007-12-20 16:46:12 UTC
Permalink
Hello Spiro,
Post by Spiro
I'm trying to get up and running xHarbour wiht Mediator for MySql, but
with no luck so far. The documentation on the OTC site is zero. When I
run their sample xHarbour connection, it works. My altered code (1 line
added) doesn't. I have only added this line
I've seen you already know the reason of your problem.
The full documentation of Mediator server/client is in the file
medcl\doc\progd40e.pdf installed with Mediator client.

Regards,
Jacek
Loading...