473,385 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Access Database on Web Servers

I am an experienced Access user but recently moved an Access database
to the web for my employer.

We use a host that does not allow the use of data access pages.

Is there anyway to pre-build a query and/or report in Access that could
generate an Excel download? I was thinking of using a macro, but I
have no idea how to invoke the macro.

Thanks in advance!

Kevin

Nov 13 '05 #1
4 2004
ctkevin wrote:
I am an experienced Access user but recently moved an Access database
to the web for my employer.

We use a host that does not allow the use of data access pages.
Not surprising, DAPs are really just a mini Access running inside a web
page and gets the data from the MDB direct from the client side, this
would require that the client's PC could see a share on the web server
and see the MDB. It's a shitty marketing ploy to make Access users think
they can web enable their application and whoever invented it should be
hanged, drawn and quartered, stitched together, brought back to life and
killed all over again.
Is there anyway to pre-build a query and/or report in Access that could
generate an Excel download? I was thinking of using a macro, but I
have no idea how to invoke the macro.


That would require that Access actually ran on the server, I seriously
doubt your ISP would allow that either, they want their server to stay
up for more than half a day and/or can't afford to hire a full time
person to kill the hung processes as Access displayed it's error
messages to no-one.

You need to look into using ASP 3.0, ASP.NET, CGI, Cold Fusion or
similar technology to web enable the application.

--
This sig left intentionally blank
Nov 13 '05 #2
Hey Trevor - thanks for the commentary.... :)

Guess I should've mentioned that I used Dreamweaver to build an
application around this database using ASP and VB. I'm just not aware
of any method for allowing a user to take a pre-built query or report
and downloading it as an Excel file. If this can be done using ASP,
can you direct me to an appropriate resource for reading? I have
several books on ASP I just don't know where to begin looking.

Nov 13 '05 #3
ctkevin wrote:
Hey Trevor - thanks for the commentary.... :)

Guess I should've mentioned that I used Dreamweaver to build an
application around this database using ASP and VB. I'm just not aware
of any method for allowing a user to take a pre-built query or report
and downloading it as an Excel file. If this can be done using ASP,
can you direct me to an appropriate resource for reading? I have
several books on ASP I just don't know where to begin looking.


Using normal BASIC I/O you can produce a csv file, readable in Excel but
since ASP's version of VBScript is a little light BASIC i/o is not
implemented and you need to use the Scripting FileSystemObject, which
may prove troublesome is the host is running an older version of some AV
programs with script blocking.

Otherwise it would need to have the Excel object libraries on there for
you to create an Excel object to create the excel file. You'll need to
know the local and virtual paths (local to create, virtual for user to
download it), they're available in the server environment
(Request.ServerVariables, PATH_INFO and PATH_TRANSLATED IIRC)
--
This sig left intentionally blank
Nov 13 '05 #4
kevin,

You should never attempt to open MS Excel or any other office
application directly from your web application on your server. This
will completely bog down your application. Instead, Microsoft has
create Office Web Components (OWC) specifically for generating Excel
worksheets and charts on the server which can then be viewed in the
browser as Excel. You can download a reference for using OWC from the
microsoft site at
http://msdn.microsoft.com/office/und...c/default.aspx. As
long as you install MS Office on the server, you will have use of OWC.

I don't use ASP any more, but here's a snippet of code I once used to
generate an Excel worksheet with OWC:

<%
Sub CreateSpreadsheet(objRS)
'Create the spreadsheet
Set ss1=CreateObject("OWC.Spreadsheet")
Set c = ss1.Constants
Set ws=ss1.ActiveSheet
'ws.range("A1").VAlignment=2

' Set the row height and column width
'ws.Columns.ColumnWidth=322
'ws.Rows.RowHeight=25

'Place the values into the cells
i=0
Do until objRS.EOF
i=i+1
With ws
'.cells(i,1).font.size=8
.cells(i,1).value=i
.cells(i,2).value=myvalue4(objRS.fields("CustomerI D"))
.cells(i,3).value=myvalue4(objRS.fields("LastName" ))
.cells(i,4).value=myvalue4(objRS.fields("FirstName "))
.cells(i,5).value=myvalue4(objRS.fields("ClassLeve l"))
.cells(i,6).value=myvalue3(objRS.fields("AvgOfTabl eResult"))
.cells(i,7).value=myvalue3(objRS.fields("AvgOfTheo Value"))
.cells(i,8).value=myvalue3(objRS.fields("CountOfCu stomerID"))
End With
objRS.MoveNext
Loop

'Export the spreadsheet
mypath=server.MapPath("theovalueexport.xls")
ws.export mypath, c.ssExportActionNone
Set c=Nothing
Set ws=Nothing
Set ss1=Nothing
End Sub
%>

OWC is OK but the fastest way to create the report is to generate a
text file and save it as a CSV file, which has already been mentioned.
Once saved you can have the user open it with a link. Even better, I
think that you can stream the output directly to the browser and have
it opened as Excel by setting Response.ContentType =
"application/vnd.ms-excel"

Here's some code to make the same report using this method:
Sub CreateTextFile(objRS)
nr=0
Set fso=Server.CreateObject("Scripting.FileSystemObjec t")
mypath=server.MapPath("theovalueexport.txt")
Set mytextfile=fso.CreateTextFile(mypath,True)

mytextfile.writeline
"#,CustomerID,LastName,FirstName,ClassLevel,Actual Value365,TheoValue365,Voyages365"

Do until objRS.EOF
nr=nr+1
mytext=nr & "," & myvalue4(objRS.fields("CustomerID")) & "," &
myvalue4(objRS.fields("LastName")) & ","
mytext = mytext & myvalue4(objRS.fields("FirstName")) & "," &
myvalue4(objRS.fields("ClassLevel")) & ","
mytext = mytext & myvalue3(objRS.fields("AvgOfTableResult")) & "," &
myvalue3(objRS.fields("AvgOfTheoValue")) & ","
mytext = mytext & myvalue3(objRS.fields("CountOfCustomerID"))
mytextfile.writeline mytext
objRS.MoveNext
Loop

mytextfile.close
Set mytextfile=Nothing
Set fso=Nothing
End Sub
%>

I hope this helps you.

Bill E
Hollywood, FL

ctkevin wrote:
Hey Trevor - thanks for the commentary.... :)

Guess I should've mentioned that I used Dreamweaver to build an
application around this database using ASP and VB. I'm just not aware of any method for allowing a user to take a pre-built query or report
and downloading it as an Excel file. If this can be done using ASP,
can you direct me to an appropriate resource for reading? I have
several books on ASP I just don't know where to begin looking.


Nov 13 '05 #5

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

Similar topics

3
by: cooldv | last post by:
i am running a website on Windows 2000 server with ASP 3 webpages and Access 2000 database. (with a hosting company) traffic is slow at this time but expect to grow. lately i have been reading...
0
by: Todd Calhoun | last post by:
Hi, I've got a MySQL database being hosted by a company. The site has phpMyAdmin for external administration, but I'd like to use a program like EMS MySQL manager, or maybe even an OBDC...
3
by: dstewart | last post by:
Situation: One common MySQL database server on SuSE 9.1 with all updates. Uses 'rinetd'. Has entries for the appropriate IP addresses of all servers. NOTE: If the appropirate entries are NOT in...
25
by: cory | last post by:
Hi, I have an Access database and am having an ASP.NEt application written for it. It is almost complete. I have a hosting company that I signed up with a month ago but before I did anything I...
6
by: Serious_Practitioner | last post by:
Good day all, and thank you in advance for your help. No - MANY thanks in advance for your help - I know nothing about using databases on Web servers. I am about to discuss a project with a...
4
by: Singularity | last post by:
Hi The technical support guys at my company have set up my system so that the server containing the MS Access database is on one server, while the pages that should access the database are on...
17
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
7
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
13
by: magickarle | last post by:
Hi, I got a pass-through query (that takes about 15 mins to process) I would like to integrate variables to it. IE: something simple: Select EmplID from empl_Lst where empl_lst.timestamp between...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.