Haslett, Andrew
andrew.haslett at ilc.gov.au
Mon Dec 22 06:02:46 CST 2003
HI Mark. If your initial (calling) file has the .stm extension then you won't be able to include any .asp files. You will need to either rename the .stm file to .asp, or tell your web server to send .stm files to the asp parser. Cheers, Andrew -----Original Message----- From: Mitsules, Mark S. (Newport News) [mailto:Mark.Mitsules at ngc.com] Sent: Monday, 22 December 2003 10:19 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] X-Posted: AccessD / dba-Tech : ASP 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 _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd 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.