Archive for February, 2008
Connecting MySQL with OpenOffice Base
OpenOffice Base makes it incredibly easy to hook up to a MySQL database. Once this is accomplished you can easily create a front end to browse through your data, edit it, report on it, etc. Below are a few steps I took to create a functional setup:
What I did was:
- Have OpenOffice installed
- Access to a database (for this example I used my wp_posts table from Wordpress) from the workstation running OpenOffice
- Downloaded MySQL® Connector/J and installed
- Within OpenOffice clicked, “Tools > Options > OpenOffice.org > Java > Class Path… > Add Archive…”
- Selected “mysql-connector-java-5.1.5-bin.jar” or current version
- Restarted OpenOffice (had to make sure the process was fully “killed”)
- Created a new database within OpenOffice
- Within OpenOffice, clicked “File > New > Database”
- clicked the “Connect to an existing database” radio button
- selected “MySQL” from the drop down list
- clicked the “Next >>” button
- selected the “Connect using JDBC (Java Database Connectivity)” radio button
- clicked the “Next >>” button
- entered the “Name of the database” into the text field
- entered the MySQL “Server URL” into the text field
- clicked the “Test Class” button and received “The JDBC driver was loaded successfully”
- clicked the “Next >>” button
- entered as “User name” into the text field
- checked the “Password required” checkbox
- clicked the “Finish” button and save
- Made a form based on wp_posts:
- This screenshot is of the form I made to browse the raw data of my Wordpress posts from my Thoughts and Notions weblog and is showing data from this post in particular:

Windows CopSSH Clear
On a default install of CopSSH 1.4.2 I noticed that you cannot run “clear” after launching “Start a Unix BASH Shell”.
Type in “cmd /c edit” to open the MS-DOS Editor and enter the following:
cmd /c cls
Save the file as “clear” and exit the editor. Back in the shell, try running “./clear” and you should receive pleasant results.
reCAPTCHA plugin error messages
By default, on two of my installs of reCAPTCHA Plugin for WordPress - v2.7, I receive no error message if the captcha is entered incorrectly… the user of the weblog is to assume that they made a mistake I guess…
That is until I wrote this script to check for error messages being passed around on the URL by the plugin:
if (window.location.search != "") {
var searchArray = window.location.search.split("&");
for (var i=0; i < searchArray.length; i++) {
var searchSubArray = searchArray[i].split("=");
if (searchSubArray[0] == "rerror" &&
searchSubArray[1] == "incorrect-captcha-sol") {
document.write("<p><small style=\"color: red;\">The two words in the picture were typed incorrectly.</small></p>");
}
}
}
</script>
Just drop that snippet into your “comments.php” template. When the captcha is filled in incorrectly, the plugin adds “rerror=incorrect-captcha-sol” to the url. This checks for that string, and if found, writes an error message in red.