Hope this is in the right place.
Attempting to read from serail port, XP, admin accnt.
if there are chars in the buffer, then the following throws error: Permission denied, code: 800A0046 on the check of AtEndOfStream.
forRead=1
Set fso = CreateObject("Scripting.FileSystemObject")
Set comObj = fso.OpenTextFile("COM3:9600,N,8,1", for Read)
if not comObj.AtEndOfStream then
msgbox comObj.ReadLine
end if
com.Close
Writing on the other hand works just fine with the following:
forWrite=2
Set fso = CreateObject("Scripting.FileSystemObject")
Set com = fso.OpenTextFile("COM4:9600,N,8,1", forWrite)
com.Write "Hello World"
com.Close
Not sure its relevant but I'm using com0com to connect the two ports (3 & 4)
I should perhaps also add that using the MSCOMM obj in VB6 I can read and write no problem.
Any ideas why the permission denied for the read.