Form to Excel Spreadsheet

  • Thread starter Thread starter SS
  • Start date Start date
S

SS

Hi

I have a form which submits to a spreadsheet which works fine as long as the
spreadsheet is in the fpdb folder. I really wanted it to save to a subweb
which also has a fpdb folder, but for some reason it doesn't work in a
subweb - is there away around this. Both webs have a global.asa file


Alternatively it could submit to another folder on the root ie fpdb2 but
that doesn't seem to work either. All folders have allow scripts to be run
and allow files to be browsed unticked.

Any ideas would be great
thanks Shona
 
You have to place the form and database in the same web or you have to use a System DSN or file
path. You should consider use Access since you are writing data for storage.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Hi

Thanks for that yes the form and the file were in the same web. Yes I would
rather use access but the customer requires it in an excel format.

It just seems strange if I can get it to work on the root but not the subweb
is there something I would need to change in the global.asa file?

Cheers Shona
 
You can use ASP to generate an Excel spreadsheet from the data stored in Access.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Oh great that would help is there a link somewhere that would tell me how to
do it?
Cheers Shona
 
See:
http://www.codetoad.com/asp_excel.asp

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Thanks

obviously getting there gets as far as downloading into excel but is trying
to open an asp file in excel

This is what I have put - any ideas would be great thanks
<%

Response.ContentType = "application/vnd.ms-excel"

%>

<html>

<head>

<title>test</title>

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="Microsoft Border" content="t">

</head>


<body BACKGROUND="../../../../_images/pfeil_bg.jpg" BGCOLOR="#ffffff"
LINK="#ff0000" ALINK="#ff6666" VLINK="#aaaaaa">

<div align="center"><center>

<% set objconn=server.createobject("adodb.connection")

connpath="DBQ=" & server.mappath("test.mdb")

objconn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & connpath

set objrs=objconn.execute("select * from results")

%>





<TABLE BORDER=1>

<TR>

<%

' Loop through each Field, printing out the Field Names


For i = 0 to objrs.fields.count - 1

%>

<TD><% = objrs(i).name %></TD>

<% next %>

</TR>

<%


' Loop through rows, displaying each field


while not objrs.eof

%>

<TR>

<% For i = 0 to objrs.fields.count - 1

%>

<TD VALIGN=TOP><% = objrs(i) %></TD>

<% Next %>


</TR>

<%

objrs.MoveNext


wend

objrs.Close

objconn.close

%>
 
Ok,

Create a new blank page in FP, remove ALL content from the page in HTML / Code View, then paste the
following into notepad, then copy and paste in your page, save the page with a .asp extensions, then
link to it.

==============Start of Code (don't include this line)

<%
set objconn=server.createobject("adodb.connection")
connpath="DBQ=" & server.mappath("test.mdb")
objconn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & connpath
set objrs=objconn.execute("select * from results")

Response.ContentType = "application/vnd.ms-excel"
%>
<TABLE BORDER=1>
<TR>
<%
' Loop through each Field, printing out the Field Names
For i = 0 to objrs.fields.count - 1
%>
<TD><% = objrs(i).name %></TD>
<% next %>
</TR>
<%
' Loop through rows, displaying each field
while not objrs.eof
%>
<TR>
<%
For i = 0 to objrs.fields.count - 1
%>
<TD VALIGN=TOP><% = objrs(i) %></TD>
<% Next %>
</TR>
<%
objrs.MoveNext
wend
objrs.Close
objconn.close
%>

==============End of Code (don't include this line)

Nothing else is to be on this page.


NOTE: You may have to change:

Response.ContentType = "application/vnd.ms-excel"

to

Response.ContentType = "text/HTML"


--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
You are welcome!

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Back
Top