bassleader
08-12-2002, 10:44 AM
Hi,
I am working with an Access database with Wordpad documents as one of the fields. How can I extract the text from these documents to include it in a webpage? The code I am using at the moment generates an error (this is ASP and Javascript):
in HEAD -----------------------
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.Source = "SELECT * FROM table1";
var textob = Server.CreateObject("Scripting.FileSystemObject");
var text = textob.OpenTextFile(Recordset1.Fields.Item("doc_text").Value);
%>
in BODY-----------------------
<table width="100%" height="45">
<tr>
<td><%=(Recordset1.Fields.Item("title").Value)%></td>
</tr>
<tr>
<td><%=Response.write(text.ReadAll);
text.Close;
%>
</td>
</tr>
</table>
table1 has two fields, "title" and "doc_text", representing the document title and the document text respectively. The document text is held in a Wordpad file. At some point I want to use an HTML form to edit the files as well. Is this possible?
Cheers,
BL
I am working with an Access database with Wordpad documents as one of the fields. How can I extract the text from these documents to include it in a webpage? The code I am using at the moment generates an error (this is ASP and Javascript):
in HEAD -----------------------
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset");
Recordset1.Source = "SELECT * FROM table1";
var textob = Server.CreateObject("Scripting.FileSystemObject");
var text = textob.OpenTextFile(Recordset1.Fields.Item("doc_text").Value);
%>
in BODY-----------------------
<table width="100%" height="45">
<tr>
<td><%=(Recordset1.Fields.Item("title").Value)%></td>
</tr>
<tr>
<td><%=Response.write(text.ReadAll);
text.Close;
%>
</td>
</tr>
</table>
table1 has two fields, "title" and "doc_text", representing the document title and the document text respectively. The document text is held in a Wordpad file. At some point I want to use an HTML form to edit the files as well. Is this possible?
Cheers,
BL