|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
asp
I have an asp file that houses a few subs,
these subs are called from another asp page. this is the sub that pulls the categories out of the database and displays them on the main page, this code was working and now when it is called from the main page via 'call getCategories()' I get an error that says 'expected end' I don't understand why any help ? <% 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 %> |
|
#2
|
||||
|
||||
|
First, you need to use more descriptive titles for your posts. "asp" doesn't help anyone tell what your problem is, so they will tend to skip it.
Next, what is the exact error? does it tell you what line and such its on? You're sure the error is in this sub, not some part of the main page, or one of the other subs you call from inside this one? More error information makes it easier to troubleshoot code. I find it hard to just find little errors by looking at a snippet of code, so if I'm going to help, please try to give a bit more information (or wait and see if another asp 'guru' can help) |
|
#3
|
|||
|
|||
|
<%RS.MoveNext: loop%>
Turn this in to 2 lines. <%RS.MoveNext loop %> |
|
#4
|
||||
|
||||
|
Bah, can't believe I missed that.
Still, my previous comments about more descriptive subject and including more information about errors stands. DougG won't always be around to bail you out. ![]()
__________________
--Dave-- U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM= |
|
#5
|
|||
|
|||
|
i did that but it still doesn't work
|
|
#6
|
||||
|
||||
|
Does it throw the same error, or a different one? Post the precise error please, just saying "it still doesn't work" is not descriptive.
Also, as I mentioned before, have you checked to be sure that the problem is in this sub, not one of the other subs that is called from this one? |
|
#7
|
|||
|
|||
|
it seems as though any time I call a sub from the main page I receive this error:
Microsoft VBScript compilation error '800a03f6' Expected 'End' /fs.asp, line 587 line 587 is the line (in the main page) that calls the sub. like this [call getCategories()] nothing else on the line, so I am assuming it is a prob with the sub or one of the subs being called from the sub, the only thing is I am pretty sure that the subs are correct, I can give the files to you if you wouldn't mind. |
|
#8
|
||||
|
||||
|
Post the openConn() and closeConn() code. That error indicates you're missing an 'End If' statement somewhere, but may also be because you don't have a current enough version of vb. Is this file a #include file by chance? If so, try moving the include to the top of the page. I'm just throwing out some possibilities here.
Post the other code, and I'll see if that helps, or if it helps someone else figure it out |
|
#9
|
|||
|
|||
|
Hey thanks alot for the help, I really want to learn more about web programming. I will post the code
How do I check the version of vb and/or update the version of vb if needed? --------------------------------------------------------- Dim dbc Dim strConn Dim strpath 'this procedure is called wherever a connection is needed. Returns 'dbc' as active connection sub openConn() 'use appropriate connection string 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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > asp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|