Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paradox and MySQL

Status
Not open for further replies.

janbletz

Technical User
Jun 15, 2002
5
NL
I'm building a database driven website (or should i say: am trying to do so). I want to use MySQL, with data from tables in Paradox 9. Probably I have to use ODBC to export the data form Paradox (or, even better, to link a Paradox-table to MySQL so they can be accessed in real time).

How do you do this (using Windows 98 as the OS)?????

I have searched everywher, but found no answer.

jan
 
jan,

While you will need ODBC, you don't need to export your Paradox data to files that are later imported into MySQL. Instead, you can use Paradox itself to transfer (or directly edit) your remote MySQL tables directly, as if they were Paradox tables themselves.

This requires a bit of set-up however:

1. Verify the version of your MySQL server. It needs to be relatively recent. If it's not, you may need to pester your administrator to bring things up-to-date.

2. Install the MyODBC driver on your Windows machine. It's free and can be found on mysql.com. Be sure to reboot afterward.

3. Using the ODBC Administrator in Control Panel, create a USER DSN pointing to the MySQL database on your server. Work with your administrator to collect the appropriate values for configuring this driver, as some servers require different log-ins for web access vs. data entry/administrative access to the database.

4. Use either the BDE Administrator or Paradox itself to create an aliases based on the USER DSN you created. Test it by trying to connect.

Once you've done all this and gotten it working, then Paradox lets you open tables on your database server just as easily as you can open local tables. You can then use Copy, Add, Subratract, queries, and even ObjectPAL to manage that data. (It's actually one of the best features of Paradox, thru heterogeneous access to multiple, disparate data sources.)

Note: You may be tempted to include the database username and password in either your ODBC DSN or your BDE alias. Do NOT do this unless you can guarantee you will be the only person using that computer. These are stored as plaintext in your Registry and easily accessible by anyone with the slaightest amount of knowledge. It may not seem like a risk, however, it may be instructive to use RegEdit to search for Keys containing "password", "pass", "pw" and other varations on the phrase. I know I was rather startled with the results.

Hope this helps...

-- Lance
 
I'm getting there! Thank you, your reply was very helpful.

But I don't understand step 3. I don't have a MySQL-database yet! (I am going to host the site on my own computer). Do I have to define a tabel, so it can be linked to the paradox .db file?

I was able to read/write MySQL-tables, thanks to your help, but I want to work the other way round now.

jan
 
janbletz,

Yes, just as with other remote servers (or certain local databases, like Access), you need to have a database to serve as a "container" for your project before you can create tables and so forth.

Check with your web server's administrator. Odds are that a database was created for you when you were given access to the database server. At the very least, you'll be able to find out what server management tools may have already been installed on the server.

If you're the administrator and aren't able to access the server, be sure to check the rights granted to the database and its tables.

Once the database is created, the proper drivers are installed, and you can connect to the database, you can either use the interactive tools of Paradox or you can use passthrough SQL queries to create the tables, depending on your familiarity and comfort level. If you're new to SQL itself, you might consider looking at both the LOCALSQL.HLP file as well as the online MySQL documentation, which contains a pretty decent set of tutorials.

Hope this helps...

-- Lance
 
OK, I'm going to try this:
- to build an (empty) database with MySQL, with the same structure as the one in Paradox.
- to link the two, as you explained in your last mail.

Can't be too difficult! (If this is indeed how this is done. Accessing a MySQL from within Paradox is a lot easier...)

So thanks again.

jan


 
Jan,

It is. Be sure to create appropriate indicies on your MySQL tables for linking purposes, just as you would for Paradox tables.

Good luck!

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top