Computer Learning Zone CLZ Access Excel Word Windows

I believe in innovation and that the way you get innovation is you fund research and you learn the basic facts.

-Bill Gates
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > ASP
 
Active Server Pages Forum


Back to Active Server Pages Forum
 

ASP Include File Upload Images   Link  
Dg Ewing 
6 months 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
6 months ago
The include directive should be OUTSIDE of your ASP tags
Richard Rost
6 months ago

Richard Rost
6 months ago
Same with the bottom one too. Outside of all ASP tags.
Dg Ewing
5 months 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
5 months 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
5 months 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
5 months ago
Should
<!--#include file = ../process/"closeconnection-process.asp"-->
be
<!--#include file="../process/closeconnection-process.asp"-->
Dg Ewing
5 months ago

Dg Ewing
5 months 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
5 months ago

Dg Ewing
5 months ago
the top file is the executed file and the middle is "include" file and the bottom is the error
Dg Ewing
5 months 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
5 months ago

Dg Ewing
5 months 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
5 months ago
Figuring your mistakes out on your own is the BEST way to learn. :)
Alex Hedley
5 months 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, below.
 


Back to Active Server Pages Forum
 

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 
 

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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn