Mitsules, Mark S. (Newport News)
Mark.Mitsules at ngc.com
Fri Dec 19 09:38:53 CST 2003
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 ***