Gossamer Forum
Home : Products : DBMan : Discussions :

Export the database?

Quote Reply
Export the database?
Can anyone tell me if it's possible to export the database as a comma delimited file?
I have a database of members of a professional association that I want to make available to all members for download as a batch file. Something they could import to their MS Outlook or Excel programs.
It would be really great if this could be a 'live' file....that is, it's the latest version of the database, not something I prepared a week ago that's now out of date.

All help greatly appreciated.

Regards,

Mikey

Quote Reply
Re: Export the database? In reply to
Mikey,

There a pretty slick addition you can add to you search form, or at least I use it from my search form. Users can then choose to get a printout of the database. This will save the database to a .txt file which can be imported into excel.

On the results page you would just need to add a link to the file so it would either open it in their browser, or allow them to save the .txt file.

You can define the delimiter within the output line.

In the FAQ noted below under the section "Files / Records" look for a thread called "Output fields to a text file".

This is great, I used it so a client could always get an updated price list from his website.

As part of my custom search form I used the following to be sure I would get all the records in the database:

<TR><TD colspan=2><$font>Number of Hits Per Page: <SELECT NAME="mh">
<OPTION VALUE="0">Choose one:
<OPTION VALUE="10">10
<OPTION VALUE="25">25
<OPTION VALUE="50">50
<OPTION VALUE="100">100
<OPTION value="$number_of_records">All Records</SELECT></font></TD></TR>

And I changed the output line so that it would display the output with the pipe delimiter like this:

$output .= "$rec{'Mfg'}|$rec{'Mfg_ID'}|$rec{'Printer'}|$rec{'Type'}|$rec{'Price'}|$rec{'Price5_10'}|$rec{'Price10+'} \n\n";

You could just change the pipes to commas if that is what you prefer to use.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Export the database? In reply to
LoisC....to the rescue yet again!
Your solution looks perfect for my needs. I'll try it out and let you know how it goes.

Thanks again,

Mikey