Mitsules, Mark S. (Newport News)
Mark.Mitsules at ngc.com
Mon Dec 22 05:49:14 CST 2003
Jim, Andrew, Thank you for your responses. I kind of married both of your suggestions. If I understood Andrew, the file should be named ".asp" to correctly call the ASP parser. So, I moved the .asp code into a separate file, and tried calling it from my .stm file using two different methods. Neither is creating an entry in the database, but yet again, if I call the .asp separately, it works fine. Method1: <!--#include file="Index.asp"--> Method2: <!--#include virtual="/Divisions/Sub/E13/Scripts/dbTracking/Index.asp"--> Any other suggestions for today? Mark P.S. Today is my last day at work, until January 5, 2004. Happy Holidays to one and all! -----Original Message----- From: Jim Lawrence (AccessD) [mailto:accessd at shaw.ca] Sent: Friday, December 19, 2003 8:35 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] X-Posted: AccessD / dba-Tech : ASP Hi Mark: >Can you insert ASP code into an HTML page that >does not have the .asp extension? In a word, "yes". Below is a very simple example. Given a file named "time.incl" that looks like: <% Response.Write(Time) %> ...then; call the file from a web page: <html> <body> <h3>The time is: <!--#include file="time.incl"--></h3> </body> </html> Now that was easy. See more about it at http://www.w3schools.com/asp/asp_incfiles.asp HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mitsules, Mark S. (Newport News) Sent: Friday, December 19, 2003 7:39 AM To: '[AccessD]'; '[dba-Tech]' Subject: [AccessD] 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 *** _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com