[dba-Tech] X-Posted: AccessD / dba-Tech : ASP

Haslett, Andrew andrew.haslett at ilc.gov.au
Fri Dec 19 15:55:53 CST 2003


You'd need to tell IIS to send pages with a .stm extension to the ASP
parser.

However, .stm files are already being sent to the ssinc.dll by default.

(IIS -> Website Properties >Home Directory -> Configuration)

Can't have both I'm afraid, that's why asp files have a different extension.

If your network admins are being anal about it, suggest a new type of
extensions (say .sts) to parse ASP files - maybe they're that stupid that
they'll think this is different/safer than .asp files.

PS. You can <include> files from within an ASP file, which is almost
identical to SSI includes.

Cheers,
Andrew


 

-----Original Message-----
From: Mitsules, Mark S. (Newport News) [mailto:Mark.Mitsules at ngc.com] 
Sent: Saturday, 20 December 2003 2:09 AM
To: '[AccessD]'; '[dba-Tech]'
Subject: [dba-Tech] X-Posted: AccessD / dba-Tech : ASP

Quick question...

Can you insert ASP code into an HTML page that does not have the .asp
extension?

I have a requirement in our corporate intranet to maintain our pages using
server-side-includes.  This means that all pages have a .stm extension.  How
can I insert the following snippet (many thanks to Drew) into my pages?  It
works perfectly in my "Test.asp" page but hasn't yet worked on a .stm page.
Any suggestions?

Mark

*** BEGIN CODE ***
<%
strPageName="Test.asp"
dim cnn
dim rs
dim strSQL
dim strPageName
dim strIP_Address
strIP_Address=request.ServerVariables("REMOTE_ADDR")
set cnn=server.createobject("ADODB.Connection")
set rs=server.createobject("ADODB.Recordset")
cnn.Provider="Microsoft.Jet.OLEDB.4.0"
cnn.Open "\\NNSI1\Corp\PROJECTS\E13\WebLog\Statistics.mdb"
strSQL="SELECT tblHitCounter.PageName, tblHitCounter.IP_Address FROM
tblHitCounter;"
rs.Open strSQL,cnn,1,3
rs.AddNew
rs.Fields(0).value=strPageName
rs.Fields(1).value=strIP_Address
rs.Update
rs.close
set rs=nothing
cnn.close
set cnn=nothing
%>
*** END CODE ***
_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com

IMPORTANT - PLEASE READ ******************** 
This email and any files transmitted with it are confidential and may 
contain information protected by law from disclosure. 
If you have received this message in error, please notify the sender 
immediately and delete this email from your system. 
No warranty is given that this email or files, if attached to this 
email, are free from computer viruses or other defects. They 
are provided on the basis the user assumes all responsibility for 
loss, damage or consequence resulting directly or indirectly from 
their use, whether caused by the negligence of the sender or not.


More information about the dba-Tech mailing list