SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 22nd, 2003, 03:22 PM
rayjava rayjava is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 rayjava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
asp calling functions from an include file

file------> home.asp-----------------------------------------------------


<html>
blah, blah, blah

<%
line # 587 call getCategories()
%>

endFile-----> home.asp-------------------------------------------------


file----> db.asp ---------------------------------------------------------

sub openConn()

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=******;"

Set dbc = Server.CreateObject("ADODB.Connection")
dbc.open strConn
end sub

sub closeConn()
if isobject(dbc) then
if dbc.State = adStateOpen then
dbc.Close
end if
set dbc = nothing
end if
end sub
%>
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'// Get Categories //
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<%
sub getCategories()
Dim RS
Dim SQLStmt
'set ID=Request.queryString("ID")
call openConn()
SQLStmt = SQLStmt &"SELECT CATEGORYID,CATEGORYNAME,CATEGORYDETAILS "
SQLStmt = SQLStmt & "FROM tbl_CATEGORIES"
SET RS = DBC.Execute(SQLStmt)
%>
<%Do While Not RS.EOF%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD colSpan=2 width="100%"> <IMG alt="" border=0
SRC="IMAGES/catpila.gif"> <A
class=categorylinks
href="http://68.194.73.6:84/products.asp?ID=<%= RS.Fields("CATEGORYID")%>"
title="Click to view category"><B><%= RS.Fields("CATEGORYNAME")%> </B></A>
</TD>
</TR></TBODY></TABLE>
<%RS.MoveNext
loop%>

<%
call closeConn()
%>
<%
end sub
%>


endFile----> db.asp------------------------------------------------------



------------------the error--------------------------------------------------

Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/home.asp, line 587

Reply With Quote
  #2  
Old July 22nd, 2003, 04:23 PM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
put your code in {code} {/code} tags (replace {} with []) to make it easier to read. your problem could also be in home.asp so be sure to check that as well. any unclosed statements will cause that error.
__________________
Programmer's Corner

Reply With Quote
  #3  
Old July 22nd, 2003, 06:32 PM
rayjava rayjava is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 21 rayjava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm sorry but I don't understand

Reply With Quote
  #4  
Old July 24th, 2003, 07:45 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
He's saying you should put any code you have to post inside tags like this ['CODE] your code ['/CODE] (but delete the '). That makes it show up like this:
Code:
 your code 
which is easier to read, and preserves your tabs and such. From looking at your code in this post and your other thread, it doesn't look like you have any unclosed statements.

From your post title, it looks like you are putting your subs in an include file? If this is done incorrectly, it will give you that error. Look at http://www.evolt.org/article/Includ...in_ASP/17/1344/ and be sure you follow all the directions to include your file correctly, so that you can use your subs.
__________________
--Dave--

U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM=

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > asp calling functions from an include file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway