Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convert Clarion -> MySQL

1,908 views
Skip to first unread message

Chris Ammann

unread,
Jul 3, 2003, 12:25:24 PM7/3/03
to
Is it possible to convert a Clarion database in a MySQL database?
In Clarion 6.0 exist just a function to convert it in a *.tps or *.txd file.
Are there any tools?

Thanx in advance.
Chris
ch...@caltechnix.com.mx


Ricardo Lopez Celani

unread,
Jul 3, 2003, 1:20:18 PM7/3/03
to
Chris.
You can export your Clarion data (I supose are DAT or TPS files) to ASCII
and then import them to MySQL.
I´ve been using a great tool to admin/manage MySQL that has a feature to
import from ASCII files, this tool is EMS MySQL Manager.

Regards

--
Ricardo Lopez Celani
Unisolutions S.A.
rlo...@unisolutions.com.ar


"Chris Ammann" <ch...@caltechnix.com.mx> escribió en el mensaje
news:3f04...@news.softvelocity.com...

Chris Ammann

unread,
Jul 3, 2003, 3:26:18 PM7/3/03
to
But the ASCII file (*.txd) doesn't have the structure of MySQL. -> So it's
not possible to import them to MySQL.
Does your ascii file have a MySQL structure?

Regards Chris

"Ricardo Lopez Celani" <rlo...@unisolutions.com.ar> escribió en el mensaje

Ben Kim (Vertical Dimensions, Inc.)

unread,
Jul 3, 2003, 3:17:37 PM7/3/03
to
Chris,

Yes it is possible to write a conversion program from a Clarion TPS/DAT
structure to MySQL using the TPS/DAT driver and generic ODBC driver.
Personally I would hand code this type of project.

Example (This is over simplified but should get you started)

MyTPSTable FILE,DRIVER('TOPSPEED'),PRE(TPS)
RECORD RECORD
StringField STRING(10)
DateField LONG
...
END
END

MySQLTable
FILE,DRIVER('ODBC'),PRE(MySQL),NAME('MySQLTable'),OWNER('....')
RECORD RECORD
StringField CSTRING(11),NAME('StringField') !Original
plus one unless you want a CHAR on the backend
DateField STRING(8)
DateField_GRP GROUP,OVER(DateField)
DateField_Date DATE
DateField_Time TIME
...
END
END

CODE
OPEN(MyTPSTable)
OPEN(MySQLTable) !Assumes the table structure exists on the
backend - you can have clarion create it but you miss out on quite a few
'features' of the DB

SET(MyTPSTable)

LOOP
NEXT(MyTPSTable)
IF ERRORCODE() THEN BREAK.

MySQL:Record :=: TPS:Record !I prefer to move
field by field here so I have control over formatting, validation, etc.

ADD(MySQLTable)
IF ERRORCODE()
IF ERROCODE() = 90 !A SQL Driver Error
MESSAGE('An error occurred when trying to add a
new record (' & FILEERRORCODE() & ': ' & FILEERROR())
!break out, ignore, whatever you want here
END
END
END

CLOSE(MyTPSTable)
CLOSE(MySQLTable)
MySQLTable{PROP:Disconnect}

RETURN

Of course you could use ABC to do this, even the progress template. If you
are converting an existing application to MySQL, backup your current DCT,
change the driver to ODBC (and possibly change the field types - the DCT
editor will let you know)...and your off. Check the NG's here for
additional tips, pitfalls etc. of using MySQL with Clarion (IE: DSN-Less
connections, using PROP:SQL instead of Clarion File Loop, Driver Strings
such as /ZEROISNULL=...). And always remember to read the documentation on
the SQL drivers.

Hope this helps you get started!

Ben Kim
C5.5 EE Rev H
C60.0 EE EA4.5

"Chris Ammann" <ch...@caltechnix.com.mx> wrote in message
news:3f04...@news.softvelocity.com...

Ricardo Lopez Celani

unread,
Jul 3, 2003, 5:42:45 PM7/3/03
to
What I do is create a conversion program to write ASCII files with the
fields that I need in MySQL, with the right format (picture) and size.

Regards.


--
Ricardo Lopez Celani
Unisolutions S.A.
rlo...@unisolutions.com.ar

"Chris Ammann" <ch...@caltechnix.com.mx> escribió en el mensaje

news:3f047561$1...@news.softvelocity.com...

Ubaidullah Nubar

unread,
Jul 4, 2003, 2:12:53 AM7/4/03
to
There is a template released by Roberto Artigas that does this. I think you
can find it at par2.com
The download file is called dct2sql.zip and has templates for conversion to
various sql backends.

Regards,
Ubaidullah Nubar,
C55, CPD2.1+LPM,
ASP,PHP - CodeCharge
PB+PFC

"Chris Ammann" <ch...@caltechnix.com.mx> wrote in message
news:3f04...@news.softvelocity.com...

Kelvin Chua

unread,
Jul 4, 2003, 2:37:21 AM7/4/03
to
http://www.clarionpost.com/modules.php?name=Downloads&d_op=viewdownload&cid=
1

Thanks.

Kelvin Chua
SINGAPORE

"Ubaidullah Nubar" <ubaidul...@hotmail.com> wrote in message
news:3f05...@news.softvelocity.com...

Lesley Dean

unread,
Jul 4, 2003, 7:39:13 AM7/4/03
to
Hi Chris,

Why not do it the easy way? File Manager 3 automatically creates the tables
on the MySQL backend, and converts the data from your TPS / DAT files! It's
supports an increasing number of file drivers and backends, and
automatically manages and upgrades your backend file structures for you!

For more info: http://www.capesoft.com/accessories/fm3sp.htm (com may be
down - try co.za!)

... or feel free to email me with any questions!

Hope this helps.

--
--------------------------
Lesley Dean
CapeSoft
www.capesoft.com


"Chris Ammann" <ch...@caltechnix.com.mx> wrote in message
news:3f04...@news.softvelocity.com...

Simon Newell

unread,
Jul 4, 2003, 11:53:20 AM7/4/03
to
Hi Lesley

Would the same apply for SQL anywhere , would FM3 work with this as well ???

Many thanks


Simon L Newell
Shackerley Group


Chris Ammann

unread,
Jul 4, 2003, 3:42:44 PM7/4/03
to
I downloadet the template file and i registrated them in the template
registry and got a new "zdct2sql-Class"
But i can't use my new template.
I tried it with:
- made a Button, Call a procedure, select procedure type
- made a Button, Embeds, Select Embed type
- Populate -> Control Template
There's no dct2sql i could use

What am i dooing wrong?
Regards Chris
C55, C6

"Ubaidullah Nubar" <ubaidul...@hotmail.com> escribió en el mensaje
news:3f05...@news.softvelocity.com...

Roberto Artigas Jr

unread,
Jul 4, 2003, 2:58:46 PM7/4/03
to
Heavenes Chris -
1) Open an application that contains the dictionary you want to convert.
2) Go to the Application menu and you will find and entry that shows you the
utility templates.
3) Select the DCT2MySQL template and run.
Hope that helps.
Enjoy!

Roberto Artigas Jr.
Robert <at> midsouth <dot> rr <dot> com
Why waste time learning when ignorance is instantenous?

"Chris Ammann" <ch...@caltechnix.com.mx> wrote in message

news:3f05caba$1...@news.softvelocity.com...

Lesley Dean

unread,
Jul 8, 2003, 4:20:29 AM7/8/03
to
Hi Simon,

Currently SQL Anywhere is not supported, but Sybase is most likely next on
the list of supported drivers. No time frame at this stage unfortunately,
but there a few things on my list of things to do, and then we'll get stuck
into it! - I know - so helpful! :)

Hope this helps.
--
--------------------------
Lesley Dean
CapeSoft
www.capesoft.com


"Simon Newell" <simon...@shackerley.co.uk> wrote in message
news:3f05...@news.softvelocity.com...

Vince Crosby

unread,
Jul 30, 2003, 1:42:56 PM7/30/03
to
What I've done is to create my files the way I want to see them in my MySQL,
define them also in a Clarion dictionary as CSV (Basic) files and then
create a program in Clarion to move the TPS data to the BASIC data
structure(s).

The final step is to use a tool like EMS MySQL Manager 2 that allows me to
upload the files to their respective MySQL tables. Voila!! Your tables are
loaded and you can view them.

If you have questions, I would be glad to help, based upon my knowledge of
the subject. I lost many sleepless nights trying to figure out what was
going on with MySQL and Clarion in the beginning. I still have some issues
but am finding the experience both easier and rewarding.

"Chris Ammann" <ch...@caltechnix.com.mx> wrote in message
news:3f04...@news.softvelocity.com...

Geoff Thomson

unread,
Jul 31, 2003, 5:37:02 AM7/31/03
to
$149 for peace of mind and never having to worry about it again. How much
time is $149 worth? FM3 will save you much more than $149 worth of time.

http://www.capesoft.co.za/accessories/fm3sp.htm

--
Geoff (at Capesoft)

PS - All viewpoints regarding Capesoft products are as unbiased as
possible - but there are no guarantees <g>.

Tel: +27 21 705 8584
Fax: +27 21 705 8587
www.capesoft.com
"Vince Crosby" <vcr...@dutyfree.com> wrote in message
news:3f28...@news.softvelocity.com...

Rolando D. Velazquez

unread,
Jul 31, 2003, 10:41:18 AM7/31/03
to
Ok here is an unbiased opinion.
FM3 is worth at LEAST every dollar times 10.
And the Beta price is a sweet deal.
I now make changes to my dictionary and apps without
a worry and no lost sleep.
Drop in the changes, test the system and distribute the updates.
Nothing to it, and the AutoNet feature makes it even better.

Rolando D. Velazquez
Active Performance Systems

"Geoff Thomson" <ge...@capesoft.com> wrote in message

Rocky Phelps

unread,
Jul 31, 2003, 5:20:05 PM7/31/03
to
To be completely fair, Geoff, it's more than just $149 - you also have to include the time to learn how to do it with FM3. BUT,
no question that it's SO much easier even then, and the learning curve happens only once.

Just get FM3...

Rocky

"Geoff Thomson" <ge...@capesoft.com> wrote in message news:3f28...@news.softvelocity.com...

0 new messages