Solved

including ASP code in CFM page

Posted on 2002-07-18
10
231 Views
Last Modified: 2013-12-24
I have several pages I am trying to do a quick conversion on.  I want to keep the <% tags until I get time to rewrite the code.  Every time I put the code in the page, it ends the execution of the page.  If I put it as an include file I get a "Just in time compilation error".  Are there any quick solutions for getting the ColdFusion Server to read the code?

Pages with VBscript are working great with this until it hits the ASP code.

Thanks in advance...
0
Comment
Question by:ppollei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +3
10 Comments
 
LVL 1

Expert Comment

by:ndintenfass
ID: 7163627
ColdFusion should just ignore most ASP tags.  Though, it could be you have # signs causing problems.  Can you post a code sample that is breaking CF?

If you want the code to actually execute you will need to either use CFOBJECT (not suggested) or use CFHTTP to call the ASP page from the CF page and output the results.

0
 
LVL 17

Expert Comment

by:anandkp
ID: 7164056
Hi there,

why r u having pages with halp asp & half CF code.

do one things .. conver ur pages one at a time.

so lets say u have 2 pages in ASP

page1.asp & page2.asp

convert page1.asp completely into page1.cfm

& pass the same paramters from page1.cfm to page2.asp as page1.asp was sending initially.

so ur transition aslo works fine & so does ur site.

this is what i had done for my last project & it didint give me ne-probs, as CFM code was processed by CF server & asp code by ASP.DLL.

so thigns were cool

try & let me know

K'Rgds
Anand
0
 

Author Comment

by:ppollei
ID: 7164778
Ndintenfass and Anand,

A few comments here.  I have named all the pages I am working with to *.cfm and began the convertion process.  I have changed all the include commands to be called by "cfinclude"  Most of the pages are working, but I have some that have ASP Script after I do the includes.  The pages will execute, but nothing after the ASP script is executed.  Here is an example of the code:

<cfinclude template="doc_header.cfm">

<%
Dim intpr
Dim RstPR
set rstpr = server.createobject("adodb.recordset")
set rstActivities = server.createobject("adodb.recordset")
set rstActivities = cnncontracting.execute ("select ActivityID,Name from tblactivities order by name")
set rstBusSize = server.createobject("adodb.recordset")
set rstCompete = server.createobject("adodb.recordset")
set rstbussize = cnngivenname.execute("select x, y from tblxy order by z")
set rstcompete = cnngivenname.execute("select a, b from tblabc order by a")
set rstfy = server.createobject("adodb.recordset")
set rstfy = cnncontracting.execute ("select fy from tblfy")
%>

<script language="vbscript">
Sub LookupCS()
If len(pr.txtxy.value) > 0 then
     strname = pr.txtxy.value

When I include the ASP script in the file it shows no errors, if I write the asp code to a seperate file and do a cfinclude I get a "just in time compilation error".

As far as converting the pages, that is definately in the plan.  These pages were originally written by a contractor and we need them to be integrated into our current system.  I am trying to get the system running as quickly as possible and was looking for a shortcut.  I am going to look into using the CFSCRIPT.  I am not sure CFHTTP will work for the situation I have.  If I don't find a fairly quick solution I will just start the conversion.  Unfortunately that will take me a while and I am attempting to complete this portion this week.

Hope this helps some, thanks for the comments.

PSP
0
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!

 
LVL 5

Expert Comment

by:CFXPERT
ID: 7185559
When you include the asp script in the cold fusion code it works because it's calling an ASP page with an ASP file extension.  When you hard code the same code into the cold fusion script, it aborts when it hits the asp code because Cold Fusion Server cannot figure out what it is exactly.  This seems to be what's happening.  I know too well the headache of converting asp to cold fusion.  It's a long drawn out process and unfortunately there's no way around it.  Good luck to ya though.

:)
KWK
0
 
LVL 17

Expert Comment

by:anandkp
ID: 7185635
Hi there,

u said - "When I include the ASP script in the file it shows no errors, if I write the asp code to a seperate file and do a cfinclude I get a "just in time compilation error"."

how can u have a asp file included in a cf file - thru cf include.

i think what u need to do is go with the conversion process - very slowly & carefully.

convert file by file & not all of them at once. ie to say ... convert all the code in a asp file to CFM ... no matter what it is - but everything in a CF file should be CF code & not asp [reason as given by CFXPERT]

& then move ahead with this

All the best,

K'Rgds
Anand
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7192358
The bottom line is that you cannot hard code ASP into a CFM file and expect wnything to work properly.  You'll need to fully convert this code before you can expect it to work the way you need.

:)

KWK
0
 

Author Comment

by:ppollei
ID: 7201332
Thank you for the information.  I have come to the conclusion that I will have to redo the code on each page.  Since this is a non-solution to the question I will be removing the question from the system.

Thanks once again.
PSP
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7201358
Not a problem.

:)
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10794260
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation in the Cleanup topic area:

Split CFEXPERT & anandkp

Please leave any comments here within the next four days.

mrichmon
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10819635
PAQed, with points refunded (100)

GhostMod
Community Support Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question