The Linux Page

MO Paragraph trimmer filter test page

This page has empty paragraphs at the top (before this line), at the bottom and in between each paragraphs. In a way, this is a weird module!

It use the MO Paragraph trimmer filter1, written in PHP for Drupal 6.x, to remove all of those empty paragraphs. Sadly, there isn't a good way for you to check the page source, but you can test by posting a comment (I think...)

The idea ...

  • 1. Available on the Made to Order Software website.

MS-Access: INSERT INTO syntax error

Today I was creating a report and created a table with a column named 'Group'. It looked like it worked just fine so I moved on with it.

Then, at the point I wanted to insert data with a simple INSERT INTO ... statement, it broke. The statement would generate a syntax error. Yes. The simple answer is that GROUP is viewed as a keyword and thus when used as a field name it needs to be escaped (i.e. written between backward quotes: `...`). Not liking the need to escape a field name each time I use it, I just renamed the field which is even better.

The bad thing about GetRows()

In MS-Access you can create a Recordset using the OpenRecordset on a database.

Once you have that record set, you can get the rows with the GetRows() function.

It has one advantage: once the function returns the data remains consistent (it is in an array). The really bad part is... what is returned is an array. This means all the fields are now numbered instead of named.

Read/Write Cursor in MS-Access using VBA

When you want to modify a set of rows in a table but need to do some computation as you go, you probably want to use a cursor. That's my first idea. Whenever possible I do an UPDATE, but in one case that was just way too heavy (i.e. one SELECT plus one UPDATE per row!) Of course, in the end, the result is the same, but it is much less tedious to use a cursor.

How to use a cursor is very well explained in the documentation once you know the functions that you need to use to make it work. I only knew that the Recordset could be used that way.

QuickBooks and the address fields

When using the QODBC driver, it is possible to define all the Address fields. You have 5 x Addr, 5 x BlockAddr, City, Postal Code, Country, and Notes. This means quite many fields (15 to be precise.)

Trying to use the BlockAddr does not work.

The other fields work, but the result is that everything ends up in a blob of data. More or less, when you read it back, you'll have no clue what's what... That is one problem.

Now, the other problem is the following error:

Hiding columns in a Datasheet form

I have been looking for a way to hide some columns in a datasheet form.

The main reason to hide columns is to include data that you need whenever the user clicks somewhere, but that data is too technical to be shown. For instance, if you work with QODBC you have the ListID and TxnID to keep around but both look like GUID and thus are much better hidden from an every day user view.

The reason why I'm bringing this up is simple: whenever you have a field in a form that you want to hide, you click on it, go to the Format properties of that control and select Visible: No, I use that to ...

LEFT JOIN not supported

Often, when you use LEFT JOIN, you will have one table and one comparison.

Whenever you need more than one comparison, they must be put between parenthesis, otherwise you get that silly error saying: LEFT JOIN are not supported.

So you need to write something like this:

SELECT *

FROM table

LEFT JOIN other

ON (table.f1 = other.f1 AND table.f2 = other.f2)

WHERE table.f3 = 'something'

Multiple LEFT JOIN in your SQL order in MS-Access

As I was writing a report using VBA in MS-Access, I needed to get a name from a table. Yet, once in a while, that name does not exist in that table (for good reasons) and yet I'd like a more human name than the default number that you otherwise get... The result was a need for two LEFT JOIN in my SQL command.

  1. Using the result

I have three text boxes in my form:

(a) The one that the user sees with the valid result, it actually includes a simple VBA script:

=iif([text2]<>"",[text2],[text3])

(b) The one with the name when it exist

(c) The one with the ...

Automatic ComboBox in MS-Access

In MS-Access, you can select a special value for your combo boxes called:

"Find a record on my form based on the value I selected in my combo box"

In older versions of MS-Access, all you had to do is select the option and be done with it. However, the option would have no effect if the form was not properly assigned a source query.

In order to paliate to that problem, Microsoft decided to check the current form status and, if unlinked, hide the option altogether so you cannot make a mistake.

The problem is that for many people the train of thought was not automatically that way.

favicon

Have you seen animated icons in your tabs? This has been working for a while, with IE and FF and Co.

All you have to do is create an animated GIF file as your "favicon.ico", and it is better to name it .gif, by the way.

Because icons can now be pretty much any image format, not just .ico

And if you need some favicon for your site, check this one out: http://www.favicon.cc

Many of these are free!