• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 622
  • Last Modified:

I'd like to include an ASP file in a VBS script.

I have a VBS file which is scheduled through task manager.
It reads a database and sends Email notes when appropriate.

I have an ASP file which has a perfect view of the data formatted in a nice table from the same database. I would like to include this ASP in the HTML body of the mail note.

I looked around and there are some suggestions related to Reading a filescripting object but I am not sure that would work.

Does anyone have a way to do this?
0
Mswetsky
Asked:
Mswetsky
  • 3
  • 3
  • 2
  • +1
1 Solution
 
YZlatCommented:
just use

<!--#include file="myfile.asp"-->
0
 
GaryCommented:
Why not just take the code from the ASP page and put it in your vbscript file, may need some changes to work in vbscript but not hard to do.
0
 
Scott Fell, EE MVEDeveloperCommented:
The file scripting object would be used to write and read files on the server's hard drive.  You may not need to use that.

<p>Welcome to my email</p>
<!--#include virtual="/somefolder/table.asp"-->
<p>Email footer</p>

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
MswetskyAuthor Commented:
When I include the file as shown below I get error "expected statement" at the include line

The ReadRequest() function  reades the database and assigns variables to the rs and DisplayRequest() shows the HTML table with variables included in the appropriate places

emailbody ="New Request Number " & theRefID & "<BR><BR>"
      
      <!--#include file="viewLSticketEMail.asp"-->
      ReadRequest()
      emailbody = emailbody & DisplayRequest()
0
 
YZlatCommented:
you could try something like this:

<%
Response.Buffer = True
Dim objXmlHttp, emailBody

' Create an xmlhttp object:
Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.Open "GET", "myfile.asp", False
objXmlHttp.Send
emailBody = objXmlHttp.responseText
Set objXmlHttp = Nothing
%>

Open in new window

0
 
MswetskyAuthor Commented:
Gary,
There are a lot of fields in the table for the web and I tried to include them as asp but kept getting variou errors until I gave up and thought of the include method
0
 
Scott Fell, EE MVEDeveloperCommented:
The include file works just as if you had all the code in the include file on the page.  Can the code in the include file run stand alone?
0
 
MswetskyAuthor Commented:
thank you
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now