Click to See Complete Forum and Search --> : Files


December 28th, 1999, 09:45 PM
How do we open a file for both reading and writing in VB? In VC++, we have a mode "r+" which will allow us to open a file for both reading and writing. I the same way, do can we open a file for both reading and writing ?

Thanks

Leonid Shraybman
December 29th, 1999, 12:52 AM
Open pathname For mode [Access access] [lock] As [#]filenumber [Len=reclength]

where
access : Read, Write, Read Write

BTW this is described in MSDN/VB help files

Ruth Glushkin
December 29th, 1999, 01:00 AM
Using Access Mode, you can open file for read/write, for example:
Open "filename.txt" For Append Access Read Write As #1 --> a+
Open "filename.txt" For Input Access Read Write As #1 --> w+

Good Luck!