Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 18th, 2005, 06:39 AM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to retrieve a web page from access database

I want to know how i can read and post a html page stored in access db using asp. What i mean it reads the html page from access and run it on browser so we can see it . I be happy if some one show me the

select statement for such query .Thanks

 
Old May 2nd, 2005, 06:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How is the html stored? as an OLE object? or as a Memo Field?
If it's the latter, it's simply a matter of something along the lines of:
Code:
<%
Dim sConnStr
sConnStr = "Some Connection String Connecting to your DB"
Dim sSQL
sSQL = "SELECT HTMLMemoField FROM Table1 WHERE ID=1"
Dim Rs
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open sSQL, sConnStr, 3, 1
If Not Rs.EOF Then
  Response.Write Rs(0)
End If
Rs.Close
Set Rs = Nothing
%>
If you want have the data stored as a file, rather than text, then you'd be after something along the lines of this (which I've just copied from a page I use that connects to SQL Server - same basic premise though)
Code:
<%
Dim ID
ID = Request("ID")

Dim RsFile
Set RsFile = Server.CreateObject("ADODB.Recordset")

RsFile.Open "select FileData,ContentType, FileName from tblFile where FileID = " & ID, ConnStr, 2, 4

If Not RsFile.EOF Then
   Response.AddHeader "content-disposition", "attachment; filename=" & RsFile(2)
   Response.BinaryWrite RsFile(0)
End If


RsFile.Close
Set RsFile = Nothing
%>
If you're wanting to do it not with ASP - it's a whole different ballgame, and, well, that's a question for another forum.

Steven

I am a loud man with a very large hat. This means I am in charge





Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I access a Web page by Internet Explorer Hoang Excel VBA 7 March 11th, 2008 04:42 AM
If then ... for database records/web page SoC Beginning VB 6 2 September 9th, 2004 02:10 AM
access webcam from within web page bleitner VBScript 0 August 21st, 2004 09:55 AM
Access to Excell via a web page Sach Classic ASP Basics 1 April 7th, 2004 01:57 PM
Can Access accept a Null from an ASP web page? kaytrina Classic ASP Databases 5 March 20th, 2004 07:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.