Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ASP in .cfm

Status
Not open for further replies.

CFProgrammer

Programmer
Jan 29, 2001
53
US
Hey,
Does anyone know how to use asp in a .cfm file.
 
I don't think it's possible to use asp syntax in a .cfm script since you would need an entire .asp interpreter built into CF to do this. What you can do is use <cfhttp> to invoke asp scripts on the server and retrive their results with the cfhttp.filecontent variable. You could use .asp scripts like functions and call them via CF but I don't think you can use the same file for both languages.

GJ
 
Try calling it thru a script tag:

<script language=&quot;vbscript&quot;>
<% asp script %>
</script>

however, you cant exchange data between the two w/o using WDDX.
 
This is the .asp script I want to take too. I am trying to create an custom tag for this variable that is being outputted.


'Key name
Const DB_REGKEY = &quot;HKEY_LOCAL_MACHINE\Software\Allaire\Coldfusion\Currentversion\Server\&quot;

Dim strDBName, strUserName, strPassword

'Create the scripting object
Set objWshShell = CreateObject(&quot;Wscript.Shell&quot;)

'Read registry
strDBName = objWshShell.RegRead(DB_REGKEY & &quot;AdminPassword&quot;)
%>
<%=strdbname %>
 
If you want to use this asp script to get the results contained in &quot;strdbname&quot;, my <cfhttp> suggestion should work for you.

GJ
 
GJ -

Couldn't you also call this through <CFOBJECT> and avoid the ASP code all together?

sD
 
scooterDIVISION, yes you can call code through <CFOBJECT>, but the point is that you'll have to create a COM object (in VB or C++ for instance) first and register it with your webserver. Apart from that, I think you can do the thing CFPROGRAMMER wants to do through CFREGISTRY too.


<webguru>iqof188</webguru>
 
Yes, it is already created but you will have to instantiate it with the <CFOBJECT> tag. Good point though :)


<webguru>iqof188</webguru>
 
Write, but what about the cfobject tag being disabled. Hah, that I why I didn't want to go that route. The custom tage <cf_capture> by the way, works fine with cfhttp. But I wanted another way of using it.


Recapturing Your CFPassword
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top