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!

Errors passing datatype information through ASP to Word Document

Status
Not open for further replies.

skan1

Programmer
Jul 30, 2001
1
US
Hi,

The following code produces a word document in iExplorer from data on a SQL Server DB. I'm having a problem displaying a Microsoft Equation object from the DB. The equations are stored in an image field; I edit the image field in a linked Access Project where Access recognizes the datatype and opens an instance of Microsoft Equation. Is there a way to pass the equation datatype through the ASP page and have it display in the word document as a Microsoft Equation object? Any suggestions would be appreciated.

Thanks,

Dave


<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<!--#include file=&quot;Connections/FoundationsSQL_DSN.asp&quot; -->
<%
set rsSQL = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rsSQL.ActiveConnection = MM_FoundationsSQL_DSN_STRING
rsSQL.Source = &quot;SELECT EqName, EqCategory, EqDescription, EqImage FROM dbo.Equations ORDER BY EqCategory&quot;
rsSQL.CursorType = 0
rsSQL.CursorLocation = 2
rsSQL.LockType = 3
rsSQL.Open()
rsSQL_numRows = 0
%>

<html>
<Head>
<title>Word View</title>
</head>
<body>

<%
rsSQL.Movefirst

DO While Not rsSQL.EOF

file_being_created= rsSQL(&quot;EqName&quot;) & &quot;.doc&quot;

Set fso = createobject(&quot;scripting.filesystemobject&quot;)

Set act = fso.CreateTextFile(server.mappath(file_being_created), true)

act.WriteLine(&quot;<html><title>CodeAve.com</title>&quot;)
act.WriteLine(&quot;<body bgcolor='#FFFFFF'> &quot; )
act.WriteLine(&quot;Equation: &quot; & rsSQL(&quot;EqName&quot;) & &quot;<br>&quot; )
act.WriteLine(&quot;Category: &quot; & rsSQL(&quot;EqCategory&quot;) & &quot;<br>&quot; )
act.WriteLine(&quot;Description: &quot; & rsSQL(&quot;EqDescription&quot;) & &quot;<br>&quot; )

'act.WriteLine(&quot;Image: &quot; & rsSQL(&quot;EqImage&quot;) & &quot;<br>&quot; )
'Line that produces &quot;type mismatch&quot; error

act.WriteLine(&quot;Page created on: &quot; & now ())
act.WriteLine(&quot;</body></html>&quot;)
act.close

response.write &quot;<a href='&quot; & rsSQL(&quot;EqName&quot;) & &quot;.doc'>&quot; & rsSQL(&quot;EqCategory&quot;) & &quot;</a> (.doc)  &quot; & now() & &quot;<br>&quot;
rsSQL.movenext

Loop

%>
</Body>
</HTML>
<%
rsSQL.Close()
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top