Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I'm a freelance consultant, and your site's helped me with many issues. I just wanted you to know that someone does appreciate the intelligent help your site offers."

Geography

Where in the world do Tek-Tips members come from?

Microsoft VBScript runtime error '800a0036' - Bad file mode

Dabar (Programmer)
22 Dec 00 11:30
I am receiving the following ASP error message:

-----------------------------------------------
Microsoft VBScript runtime error '800a0036'    

Bad file mode

-----------------------------------------------

I create a FileSystemObject in these lines:

          Set FSO = Server.CreateObject("Scripting.FileSystemObject")
          Set CurFile = FSO.OpenTextFile(Server.MapPath("Current.txt"))

I recieve the error message during execution of the following line:

          CurFile.WriteLine(CurrentPerson)

The variable, CurrentPerson, contains a string value.
If I comment this line out, the page runs fine.

What am I missing?
Ruairi (Programmer)
22 Dec 00 12:16
The file must be opened for Input. I dont know VBScript so i can't tell you how to fix it but look for another parameter to the OpenTextFile method that will open the file for Output instead of Input.

Ruairi
ruairi@logsoftware.com
Experienced with:

VB6, SQL Server, QBASIC, C(unix), MS Office VBA solutions

ALSO: Machine Control/Automation using GE and Omron PLC's and HMI(human machine interface) for industrial applications

froggerIII (Programmer)
22 Dec 00 12:53
Dabar, you can pass three parameters to the OpenTextFileMethod. In your case:

Set CurFile = FSO.OpenTextFile(Server.MapPath("Current.txt"), FOR_APPENDING, true)

where FOR_APPENDING is a constant (integer: 8) that tells that you are appending to the file. There is an include file you can use (gives you forAppending, forWriting, etc.)so you can have these variables, but I usually create my own constants.
to append to the file: 8
to write over the file: 2
to read from the file: 1

true - if the file does not exist, create it


ray
rheindl@bju.edu
 
 

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close