Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

including ASP code in CFM page

Posted on 2002-07-18
10
Medium Priority
?
238 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
  • 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

963 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