Topic Options
#38880 - 03/22/12 05:09 AM How to read access database ??
Andy1974 Offline
OL Guru

Registered: 03/26/08
Posts: 110
Loc: Hong Kong
Dear everyone,

I've one question as below and I wanna know how can I
do it in planetpress, use VB script or planetpress plug-in 'PlanetPress database' ?

Step
----
(1) Read Access database to get receiver email address.
(2) Send email to this receiver and attach file.
(3) Goto step (1) again, if no more email address, end
the process.

How can I handle above procedures in planetpress ?
If possible, can anyone give me a example to do this ?
Due to I'm haven't enough knowledge of VB script, so except VB script, is there any other methods to do this ?

Many thanks !

Best Regards,
Andy...

Top
#38883 - 03/22/12 08:26 AM Re: How to read access database ?? [Re: Andy1974]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1931
Loc: Objectif Lune, Montreal, Qc
In this process, is the file that you want to attach already available or do you want to create it dynamically for each user and then send it? Depending on your answer, you would use a different method, but in both cases it should be fairly easy and shouldn't require any scripting.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#38924 - 03/22/12 09:12 PM Re: How to read access database ?? [Re: Philippe F.]
Andy1974 Offline
OL Guru

Registered: 03/26/08
Posts: 110
Loc: Hong Kong
Dear Philippe,

Thanks your quick reply !
Actually, the attached file is already kept in one folder and
I need to get the email address from Access database and send email one by one to each customer and attach that file until end of database.

For example, if the Access database has 10 email address. I need to send 10 email and each email attach that file which
already available in one specified folder. How can I do it ??

Many thanks !

Best Regards,
Andy...

Top
#38926 - 03/23/12 08:22 AM Re: How to read access database ?? [Re: Andy1974]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1931
Loc: Objectif Lune, Montreal, Qc
Andy,

The easiest way to achieve this is to use the PlanetPress Database task. It can connect to an Excel spreadsheet through an ODBC driver (which comes installed by default in Windows).

You could therefore create a process with the following tasks:
- Create File task.
- PP-Databasetask task.
In that task, select ODBC connection. The Excel driver is usually located under the Machine DSN. Once you select it, you will be asked to provide the path for your Excel file. Then, back in the plugin, click on Edit SQL and modify the statement so it reads something like SELECT email from [sheet1$]. Make sure to replace "email" with the actual name of the column containing the email addresses, and "sheet1" with the actual name of the sheet in which that column is found. Also, make sure you append the "$" at the end of the sheet name, as shown in my example. Click Test SQL to make sure the query works, then press OK.
Finally, make sure you select "One record per data page" in the emulation options.
- Database spltter task
Split on Field Count, and set the Max records per file value to 1
- Send email task.
In the "to" field, enter field(1,0,0,'Email',KeepCase,NoTrim) (make sure you change the name of the field accordingly).
In the Attachment tab, click on the small Folder button to navigate to where the file to attach is located, then click on the button next to it to attach it to the email.

That's it.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#38962 - 03/27/12 05:51 AM Re: How to read access database ?? [Re: Philippe F.]
Andy1974 Offline
OL Guru

Registered: 03/26/08
Posts: 110
Loc: Hong Kong
Dear Philippe,

I've tried your suggestion and now it's ok.
Many thanks your great help !

Best Regards,
Andy...

Top