In the Database FAQ is an example, in the article "how can I add a record" (method 4).