Computer Learning Zone CLZ Access Excel Word Windows

Mankind's greatest achievements have come about by talking, and its greatest failures by not talking.

-Stephen Hawking
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Active Server Pages Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
ASP Include File
Dg Ewing 
     
5 years ago
I can not get the following include line to work.  but when I copy the code from the openconnection-process.asp and insert it it works fine.
<%
<!--#include file = "openconnection-process.asp"-->

response.write Conn

SQL = "Select * from envoyT ORDER BY id"
rs.Open SQL, Conn

rs.movefirst
while not rs.eof

Response.write "Envoy: " & rs("id") & " " & rs("firstname") & " " & rs("lastname") & "<br>"
rs.movenext
wend


<!--#include file = ../process/"closeconnection-process.asp"-->


response.write Conn

%>

Richard Rost  @Reply  
          
5 years ago
The include directive should be OUTSIDE of your ASP tags
Richard Rost  @Reply  
          
5 years ago

Richard Rost  @Reply  
          
5 years ago
Same with the bottom one too. Outside of all ASP tags.
Dg Ewing OP  @Reply  
     
5 years ago
Great, error #1 fixed
now I have:
<!--#include file = "openconnection-process.asp"-->
<%

but now I am getting:

  Active Server Pages error 'ASP 0116'
  Missing close of script delimiter
  /openconnection-process.asp, line 4
  The Script block lacks the close of script tag (%>).

This is the openconnection-process.asp and line 4 is the first code line that has <%: [note i blanked out stuff that works if I don't use include  ]:

Line 4 <%

Server.ScriptTimeout = 30

' ?????????????/This is RR code see Winhost Lesson 9 and ASP 302 part 3 1:15

Dim CONNECTSTRING, Conn, rs, SQL
CONNECTSTRING ="Provider=sqloledb; Data Source=s24.winhost.com; Initial Catalog=i blanked out ; Uid=i blanked out; password = i blanked out;"
Set Conn= Server.CreateObject("ADODB.

%>
Dg Ewing OP  @Reply  
     
5 years ago
the code was not pasted correctly due to my post being too long but this is the last few lines.
                Set Conn= Server.CreateObject("ADODB.Connection")
Conn.open CONNECTSTRING
Set rs = Server.CreateObject("ADODB.Recordset")
%>


Richard Rost  @Reply  
          
5 years ago
It's better if you can post a screen shot so I can see EXACTLY what's going on, and my site will filter characters sometimes.
Alex Hedley  @Reply  
           
5 years ago
Should
<!--#include file = ../process/"closeconnection-process.asp"-->
be
<!--#include file="../process/closeconnection-process.asp"-->
Dg Ewing OP  @Reply  
     
5 years ago

Dg Ewing OP  @Reply  
     
5 years ago
Thanks Alex,  I have never understood the ../ path notation. so maybe I will learn about that also.  I recall one of RR's vid where he uses "virtual" vs "file" if the files are not in the same folder.  So I have moved everything to the root to eliminate that nuance .

However I do not think that the path was the problem and now that I added ../ the file wasn't found.  before I added ../ the file was found and errored on line 4 (the first line of code, I have 3 blank lines).  I then deleted the 3 blanks lines and the error msg said line 1.  So i know that it is trying to read the file.  I will revert to ...file = "openconnection-process.asp" and upload an image of the 2 files  and image of the error msg.

Dg Ewing OP  @Reply  
     
5 years ago

Dg Ewing OP  @Reply  
     
5 years ago
the top file is the executed file and the middle is "include" file and the bottom is the error
Dg Ewing OP  @Reply  
     
5 years ago
holy moley.....I just added as the first line of code what the error said was missing:  %>....so the very first code is a "close" and then the 2nd is an open <% and it works!!!   ???? what is that about
Dg Ewing OP  @Reply  
     
5 years ago

Dg Ewing OP  @Reply  
     
5 years ago
All this time that I have wasted, mine and yours....I KNOW what the problem was.

look at line 19 of the "openconnection-process.asp"  and yell at me for using >% as the close and not %>....it was telling me that I needed a close at the first line of code and I took that literally "at" line 4 , but should have recognized it needed a close for the open "of" line 4  at line 19 which I thought I had ...

geez....I have spent more time on chasing "silly" typos/syntax than writing all of the code.

Any way thanks for your help and support...and keep up the good stuff.
Richard Rost  @Reply  
          
5 years ago
Figuring your mistakes out on your own is the BEST way to learn. :)
Alex Hedley  @Reply  
           
5 years ago
One good trick is to make a single page with all the code, if it works then start breaking it into separate ones

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Active Server Pages Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 2:32:07 PM. PLT: 2s