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="VBSCRIPT"%>
<!--#include file="Connections/FoundationsSQL_DSN.asp" -->
<%
set rsSQL = Server.CreateObject("ADODB.Recordset"
rsSQL.ActiveConnection = MM_FoundationsSQL_DSN_STRING
rsSQL.Source = "SELECT EqName, EqCategory, EqDescription, EqImage FROM dbo.Equations ORDER BY EqCategory"
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("EqName" & ".doc"
Set fso = createobject("scripting.filesystemobject"
Set act = fso.CreateTextFile(server.mappath(file_being_created), true)
act.WriteLine("<html><title>CodeAve.com</title>"
act.WriteLine("<body bgcolor='#FFFFFF'> " )
act.WriteLine("Equation: " & rsSQL("EqName" & "<br>" )
act.WriteLine("Category: " & rsSQL("EqCategory" & "<br>" )
act.WriteLine("Description: " & rsSQL("EqDescription" & "<br>" )
'act.WriteLine("Image: " & rsSQL("EqImage" & "<br>" )
'Line that produces "type mismatch" error
act.WriteLine("Page created on: " & now ())
act.WriteLine("</body></html>"
act.close
response.write "<a href='" & rsSQL("EqName" & ".doc'>" & rsSQL("EqCategory" & "</a> (.doc) " & now() & "<br>"
rsSQL.movenext
Loop
%>
</Body>
</HTML>
<%
rsSQL.Close()
%>
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="VBSCRIPT"%>
<!--#include file="Connections/FoundationsSQL_DSN.asp" -->
<%
set rsSQL = Server.CreateObject("ADODB.Recordset"
rsSQL.ActiveConnection = MM_FoundationsSQL_DSN_STRING
rsSQL.Source = "SELECT EqName, EqCategory, EqDescription, EqImage FROM dbo.Equations ORDER BY EqCategory"
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("EqName" & ".doc"
Set fso = createobject("scripting.filesystemobject"
Set act = fso.CreateTextFile(server.mappath(file_being_created), true)
act.WriteLine("<html><title>CodeAve.com</title>"
act.WriteLine("<body bgcolor='#FFFFFF'> " )
act.WriteLine("Equation: " & rsSQL("EqName" & "<br>" )
act.WriteLine("Category: " & rsSQL("EqCategory" & "<br>" )
act.WriteLine("Description: " & rsSQL("EqDescription" & "<br>" )
'act.WriteLine("Image: " & rsSQL("EqImage" & "<br>" )
'Line that produces "type mismatch" error
act.WriteLine("Page created on: " & now ())
act.WriteLine("</body></html>"
act.close
response.write "<a href='" & rsSQL("EqName" & ".doc'>" & rsSQL("EqCategory" & "</a> (.doc) " & now() & "<br>"
rsSQL.movenext
Loop
%>
</Body>
</HTML>
<%
rsSQL.Close()
%>