Solved

including ASP code in CFM page

Posted on 2002-07-18
10
232 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

Suggested Solutions

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 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