473,473 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.

Nov 8 '06 #1
2 1333
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"
Nov 8 '06 #2
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"
Nov 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Angel Cat | last post by:
I'm exporting a large file from a large Production database (SQL). Users are currently updating and inserting new records. Does the export take a snapshot of the data when it starts ? or will...
17
by: Steve Jorgensen | last post by:
Terminology question: Is there a term for a set of records related directly or indirectly by key value in several tables? For example, a single invoice record and its line item records -or- a...
3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
20
by: akej via SQLMonster.com | last post by:
Hi, i have table with 15 columns CREATE TABLE . ( PRIMARY KEY , NULL , NULL , NULL , NULL , (50) NULL , NULL
3
by: datapro01 | last post by:
I am a DB2 DBA that has been asked to become familiar enough with SQL Server in order to become actively involved in its installation, implementation, and to review database backup/recovery...
5
by: Erich93063 | last post by:
Ok so I'm gonna attempt to explain my problem as easy as I can. I have a database of contacts (they are actually vendors). I am writing a procedure that will query the vendors and generate a tab...
3
by: Jeff Kish | last post by:
It's been a while since I had to delve into this topic, and I hope this is a good place for this question. I don't know much about schemas, probably a bit more about dtd's. I have a system that...
0
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
hi, I trying to export data display on a gridview that supports any language (like chinese, japanese, thai, french) shown here is chinese only. There is no problem exporting english language...
0
by: db2admin | last post by:
Hi, I am getting error when exporting data from mainframe using db2 connect while i am on db2 on linux. Here is what error looks like...
3
by: CeJay | last post by:
Hi All Ok this is a bit of a doozy for me. Work related question, I have been tasked with sorting out this issue at work, but don't really have much background in this field, but theres no one...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.