Question on exporting data from a database using ASP.

Discussion in 'ASP General' started by Brave, Nov 8, 2006.

  1. Brave

    Brave Guest

    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.
     
    Brave, Nov 8, 2006
    #1
    1. Advertising

  2. 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"
     
    Bob Barrows [MVP], Nov 8, 2006
    #2
    1. Advertising

  3. Brave

    Brave Guest

    Thanks so much for taking the time.

    On Nov 8, 11:31 am, "Bob Barrows [MVP]" <>
    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/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, Nov 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,894
    Alvin Bruney [MVP]
    May 10, 2004
  2. =?Utf-8?B?cG11ZA==?=
    Replies:
    2
    Views:
    992
    =?Utf-8?B?cG11ZA==?=
    Jan 10, 2005
  3. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,395
    Carl Prothman [MVP]
    Jan 12, 2005
  4. Amol
    Replies:
    0
    Views:
    369
  5. sridevi
    Replies:
    3
    Views:
    676
    sridevi
    May 11, 2005
Loading...

Share This Page