Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    317
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error in FSO object!

    hi,

    The search engine article at 4guysfromrolla is great, easy to code and understand, I try to run the original file before modifying it, and found that it got error, can anyone of you help??

    The error is :

    Error Type:
    Microsoft VBScript runtime (0x800A003E)
    Input past end of file

    The article can be accessed at http://www.4guysfromrolla.com/webtech/102499-1.shtml

    Please advice!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That looks like the result you get when you have a zero length file and try to read from it before you check to see if you are at EOF.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If not file.AtEndOfStream Then
    'Do your FSO stuff here...
    End If

    Is one way to do it...
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Regular Coder
    Join Date
    Jan 2003
    Posts
    148
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi charon

    i am going to start doing a search engine as well, but just wanted to double check if this code can be used with any servers regardless if it supports index server or anything.

    Thanks

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    FileSystemObject should work fine as long as it has read permissions (and write permissions if you're using it to write to files) on the directories in question.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    317
    Thanks
    0
    Thanked 0 Times in 0 Posts

    work great

    Thanks whammy and roy, it works great.....
    I wonder why 4guysfromrolla don't want to correct the code.

    BUT, I face a problem on the specifying the URL.
    Ok, let me decribe a bit on how what approach I'm taking or creating my web-site.

    Guess I'm using "not a common" way for creating my web-site.
    I create a templete which is in .asp format, and all the content is in .inc format (except some in .asp).
    I use FSO to maniplulate the content.

    When the user activate the link for the navigator, the name of the file will be passed to the function:

    For instance:

    Function getContent(fileInclude)
    Dim objFSO
    Dim objText
    Dim strPage

    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

    Set objText = objFSO.OpenTextFile(Server.MapPath(fileInclude))

    getContent = objText.ReadAll

    objText.Close
    Set objText = Nothing
    Set objFSO = Nothing

    End Function

    nameFile = Request.QueryString("nf") "http://www.sitename.com/default.asp?action=feature&cid=0

    If nameFile <> "" and codeID = "0" Then 'the code ID is to indicate the condition of the file
    fileName = nameFile & ".inc"
    strPage = getContent(fileName)
    ElseIf ..........
    ElseIf ..........
    End If

    1.)I really don't know what approach should i take for creating my search engine.
    After a long searching, I'm thinking of adopting one of these way:
    Way1: using the index server 3 (http://asp-help.com/articles/2000_indexserver3.asp). I feel it is easy to understand and implement. But I still have problem on specifying the URL of the pages. May be I need to manually create the link. What I mean to manually create the link is I use the split function (or may be FSO object) to split the URL return by Vpath : for instances:

    "http://www.website.com/" & Foldername & "action=" & FileName & "cid=" & id &

    Way2: use FSO method, but I 'm facing problem on get the decription of the file since the File object don't have this property.

    Way3 : Create a database with 3 fields -> Doc_ title, Doc_ decription, and Doc_URL and use SQL statement as below:
    select Doc_decription
    from yourtable
    where memofield like '*Word1*'
    or memofield like '*Word2*'

    to search for the match.

    I don't know whether they are applicable or not.


    2.) I'm wondering how do most of the web-sites implement their search engine, for example: asp101.com.
    Their content is in database -driven format as well as static content which is wtitten in .asp and html format.

    3.) I don't know whether what i'm thinking is the correct way, is the asp101.com search engine is implemented in such as way where by it searchs the page through the database which has fields such as

    Doc Title
    Doc Decription
    Doc URL
    Doc Id

    Please advice!!! I 'm lost......
    Last edited by charon; 02-13-2003 at 12:25 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •