This topic is locked
[SOLVED]

 Include Files.

11/1/2010 3:16:58 PM
ASPRunnerPro General questions
A
andie.caron author

Good day, it's been awhile and I try to post only when stumped. So here I am.
Issue: I have several scriplets (ASP functions) that I have been using for quite some time in a site (not an ASPR site). I now need to use these in an ASPR site. One function in particular checks for a user's home dir and creates it if necessary. This has been used for almost two years and works great.
When I try to use it in the After Login Event of an ASPR 6.1 project I get errors indicating that the script (asp file) is not found. I then checked here: http://xlinesoft.com/asprunnerpro/docs/how_to_add_external_files.htm and did exactly what it says and the scriptlet runs, but I get an error (type mismatch) when just doing a simple response.write of the Boolean return value (I made sure it was boolean us cBool).
That is one problem, but the big one is that my site uses virtual dirs and my scriplets need to be in a certain virdir (and path from the app root in IIS7) in order to work - the ASPR project will tie into an existing prpject, therefore the need for maintaining the current scenario. If I try to use my virdir (and move the scriplets into this virdir/path) and include this in the include directive, I get "errors indicating the asp file could not be found". I understand that ASPR wants it in the include dir, but this won't work for me.
So in summary (and I hope I've given a reasonable description and explanation) I need my scriplets to be in a virdir (called scriplets) outside of the INCLUDE directory scope that ASPR uses. And when I do this, I get type mismatch.
If anyone has any pointers that would be great.
Thanks.
ps: if more intel is required, please let me know.

Sergey Kornilov admin 11/1/2010

I'm not really sure how path to include files and type mismatch are related.
Probably you can post your error message here along with line of code that causes this.

A
andie.caron author 11/3/2010



I'm not really sure how path to include files and type mismatch are related.
Probably you can post your error message here along with line of code that causes this.


You bet, here is the actual code I have in ASPR:

<%
' After successful login

Function AfterSuccessfulLogin(username,password,ByRef data)
'** use DAL to Update Account LastLogin with current date ****
dal.SYS_Users.Value("last_login")=date
dal.SYS_Users.Param("Username")=Session("UserID")

dal.SYS_Users.Update()
%>
<!--#include file="usr/scripts/GetHomeDir.asp"-->
<%
dirOK = chkHomeDir()

response.write dirOK

response.end
Response.Redirect "USR_Followups_list.asp"
End Function ' AfterSuccessfulLogin

arrAvailableEvents("AfterSuccessfulLogin")=true
%>
Error from Browser:

Active Server Pages error 'ASP 0126'
Include file not found
/flexr/usr/include/events.asp, line 21
The include file 'usr/scripts/GetHomeDir.asp' was not found.
Dir listing for Scripts dir:

Volume in drive C is Boot Disk

Volume Serial Number is A0E1-1CCF
Directory of C:\inetpub\wwwroot\Flexr\usr\scripts
11/03/2010 12:48 PM <DIR> .

11/03/2010 12:48 PM <DIR> ..

11/02/2010 04:48 PM 1,674 GetHomeDir.asp

11/03/2010 12:48 PM <DIR> incl

1 File(s) 1,674 bytes

3 Dir(s) 258,708,533,248 bytes free
I'm missing something really simple. BTW: the type mismatch error was caused by a space in the Include Directive - that's been resolved.
Thanks.

Sergey Kornilov admin 11/3/2010

Try
<!--#include file="scripts/GetHomeDir.asp"-->
or
<!--#include file="../scripts/GetHomeDir.asp"-->

R
Roger 11/18/2010



Try
<!--#include file="scripts/GetHomeDir.asp"-->
or
<!--#include file="../scripts/GetHomeDir.asp"-->



Oh my bad and I appologize - I should have been polite enuff to get back to you folks. The actual fix was to change "include file =" to "include virtual=".
I noticed this when editing another asp page that I have added to this project.
Sorry again for not getting back sooner.

R
Roger 11/18/2010

OK, now I feel like a PUTZS! How do I mark thise post as Solved? I've done this before, but man the brain is just foobarred!
TX...

Sergey Kornilov admin 11/18/2010

Roger,
you cannot mark it as solved because you haven't started it.