Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Question on exporting data from a database using ASP. (http://www.velocityreviews.com/forums/t802333-question-on-exporting-data-from-a-database-using-asp.html)

Brave 11-08-2006 02:37 PM

Question on exporting data from a database using ASP.
 
I don't know if this is possible, but I have been amazed at what I have
learned from this group so I will throw it out there.

I have an MS Access database that I connect to through .asp pages. Can
I offer a user of my page the ability to export data from the Access
database (either feeding of a table or a query) to their hardrive in an
Excel format?

If it is possible, I have two followup questions.

1: Can you export in additional formats (Access, Word, Notepad, ...)?

2: Can you do this if connecting to a SQL server?

Thanks.


Bob Barrows [MVP] 11-08-2006 04:31 PM

Re: Question on exporting data from a database using ASP.
 
Brave wrote:
> I don't know if this is possible, but I have been amazed at what I
> have learned from this group so I will throw it out there.
>
> I have an MS Access database that I connect to through .asp pages. Can
> I offer a user of my page the ability to export data from the Access
> database (either feeding of a table or a query) to their hardrive in
> an Excel format?
>
> If it is possible, I have two followup questions.
>
> 1: Can you export in additional formats (Access, Word, Notepad, ...)?
>
> 2: Can you do this if connecting to a SQL server?
>

It is possible, but probably not in the fully automated way you are
envisioning. ASP operates in an http environment, which means that it has no
access to a user's hard drive. It will be up to the user to decide if and
where they wish to save any file you send to them. To see what I'm talking
about, put an excel file in one of your websites and browse to it. See the
prompts? There is no way to eliminate those prompts.

The other consideration is file size. You will probably want to limit the
size of the file to be streamed to the client.

The approach you will likely take is to set the Response.ContentType to the
appropriate mime setting, open a recordset and write its contents to
Response. These articles can get you started:

http://support.microsoft.com/kb/199841/
http://support.microsoft.com/kb/288130/

http://support.microsoft.com/kb/270906/
http://support.microsoft.com/kb/260239/

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Brave 11-08-2006 05:33 PM

Re: Question on exporting data from a database using ASP.
 
Thanks so much for taking the time.

On Nov 8, 11:31 am, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
> Brave wrote:
> > I don't know if this is possible, but I have been amazed at what I
> > have learned from this group so I will throw it out there.

>
> > I have an MS Access database that I connect to through .asp pages. Can
> > I offer a user of my page the ability to export data from the Access
> > database (either feeding of a table or a query) to their hardrive in
> > an Excel format?

>
> > If it is possible, I have two followup questions.

>
> > 1: Can you export in additional formats (Access, Word, Notepad, ...)?

>
> > 2: Can you do this if connecting to a SQL server?It is possible, but probably not in the fully automated way you are

> envisioning. ASP operates in an http environment, which means that it has no
> access to a user's hard drive. It will be up to the user to decide if and
> where they wish to save any file you send to them. To see what I'm talking
> about, put an excel file in one of your websites and browse to it. See the
> prompts? There is no way to eliminate those prompts.
>
> The other consideration is file size. You will probably want to limit the
> size of the file to be streamed to the client.
>
> The approach you will likely take is to set the Response.ContentType to the
> appropriate mime setting, open a recordset and write its contents to
> Response. These articles can get you started:
>
> http://support.microsoft.com/kb/1998...com/kb/288130/
>
> http://support.microsoft.com/kb/2709...com/kb/260239/
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"




All times are GMT. The time now is 02:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.