Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening HTML pages inside of an Access DB using ASP

Status
Not open for further replies.

jguy

IS-IT--Management
Nov 17, 2000
69
US
Greetings. I have a database that has two fields in it, ID and html. The ID field is just the autonumber primary key field and the html field is an OLE object field. We use a coorporate software system that will export reports in html or crystal reports, we insert these reports into the db as OLE objects. My question to you is, once I open the db and use a SQL statement like SELECT html FROM tblquote WHERE ID=<%form_ID%> how do I &quot;write&quot; or &quot;open&quot; this OLE object on the client side/browser? PLEASE HELP Joe W. Guy
Network Admin
MIS Director
 
I have no idea how to use that method. Here's the code...
<%
Dim con
dim rs
'I'm opening the record now
set con=server.createobject(&quot;ADODB.connection&quot;)
con.provider=&quot;Microsoft.Jet.OLEDB.4.0&quot;
con.Open &quot;c:/db/quote.mdb&quot;

set rs=Server.CreateObject(&quot;ADODB.recordset&quot;)

rs.Open &quot;SELECT quotehtml FROM tblquote where ID=1293&quot;,con

Response.BinaryWrite
%>
I'm lost... Joe W. Guy
Network Admin
MIS Director
 
Joe,

To create the variable to send using BinaryWrite you use the ADO.Recordset.GetChunk() method with the Field.ActualSize property to read all the data. You also need to set the content-type HTTP header.

This technique can be used to stream images, for example, to the browser. The browser must recognize the content-type in order to know how to render the data.

> we insert these reports into the db as OLE objects

Is there a content-type for these OLE objects that the browser will recognize?

-pete
 
>Response.BinaryWrite rs(&quot;quotehtml&quot;)
James, the above works, however, there is a bunch of garbage characters that write to the screen also like &quot;$ÿÿÿÿPackagePackagePackage¥'Ack.htmC:\DOCUME~1\JGUY~1.SMI\Desktop\neweq04\ack.htm/C:\DOCUME~1\JGUY~1.SMI\Desktop\neweq04\ack.htm/'&quot; before and after the html file. Is there a way to filter these off? Access seems to store these things in some sort of package or something.

Pete, you'll have to be more gentle with me on your comments. I'm new to all of this ASP stuff and really have no clue what you mean. ;-) Joe W. Guy
Network Admin
MIS Director
 
> Pete, you'll have to be more gentle with me on your comments

Sorry

> Access seems to store these things in some sort of package or something.

That is because you are storing them as OLE objects. If you have access to the HTML Text at the time you write the data to the Access table you might try changing the field type to 'Memo' and storing the text only. Memo type will store large blobs of text.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top