Opening a text file from an activeX object

Results 1 to 2 of 2

Thread: Opening a text file from an activeX object

  1. #1
    Join Date
    Dec 1969
    Posts
    17

    Default Opening a text file from an activeX object

    I&#039m trying to open a text file through an activeX control that I made. <BR>my code (which works fine in asp) is:<BR><BR>set fileObject = server.CreateObject &#039&#060;----error comes here("Scripting.FileSystemObject")<BR>HitsFile = Server.MapPath ("/webpub/other") & "hits.txt"<BR>Set InStream = FileObject.OpenTextFile(HitsFile, 1,false )<BR>OldHits = trim(instream.readline)<BR>newHits = OldHits + 1<BR>Set OutStream = FileObject.CreateTextFile(HitsFile,true)<BR>outstr eam.writeLine(newHits)<BR><BR>when i run it from my activeX object, it just gives me a runtime error. <BR><BR>any suggestions?<BR><BR>Thanks,<BR> Zac

  2. #2
    Nathan Pond Guest

    Default RE: Opening a text file from an activeX object

    Are you using the Active Server Pages library in your component? If so you have to set up a reference to create the server object.<BR><BR>However, the language you are using to write the active x component should have it&#039s own file access method. For example, Visual Basic uses the open command. Not sure about all the other languages. I can give you the full code for VB if you need it.<BR><BR>Nathan Pond

Posting Permissions

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