|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
I'm sorry but I don't understand
|
|
#4
|
||||
|
||||
|
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 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= |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > asp calling functions from an include file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|