none
800A0046 Microsoft VBScript runtime error RRS feed

  • General discussion

  • Hi there, been trying to extract a CSV out of this database but for some reason, I'm getting this error.

    Line 57
    Char 2
    Permission denied
    800A0046
    Microsoft VBScript runtime error

    Line 57 is in bold.

    Set outFile = FSO.OpenTextFile(path_output, 8, True)
    Set con = CreateObject("ADODB.Connection")

    con.ConnectionString="Provider=VFPOLEDB.1;Data Source=" & path_input & ";Mode=Share Deny None;Extended Properties="";User ID="";Password="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN="";DELETED=True;CODEPAGE=1252;MVCOUNT=16384;ENGINEBEHAVIOR=90;TABLEVALIDATE=3;REFRESH=5;VARCHARMAPPING=False;ANSI=True;REPROCESS=5;"
    con.Open
    Set rs = con.execute(sql_query)

    count = rs.fields.Count
    write_element "Name", count, rs, outFile, separator

    do until rs.EOF
    write_element "Value", count, rs, outFile, separator
    rs.MoveNext
    loop 

    Permissions and security are accessible on all folders, subfolders and files in them. What gives, in this case? Is there anything else that I might have missed out?

    • Changed type Bill_Stewart Tuesday, November 7, 2017 9:58 PM
    • Moved by Bill_Stewart Tuesday, November 7, 2017 9:58 PM We cannot troubleshoot script for user from afar
    Thursday, September 21, 2017 4:27 AM

All replies

  • Hi Vicente,

    Well ... you might have might have missed out the 21st century ;)
    Kidding aside (and sorry if that was a bit snide), why not do this in PowerShell?

    Import-Csv "filetoread.csv"

    If VBS it has to be, I have to pass however - don't remember enough of it to give a worthwhile suggestion, sorry :(

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, September 21, 2017 7:05 AM
  • This indicates that you do not have permission on the resource or that the file is already open in another process.


    \_(ツ)_/

    Thursday, September 21, 2017 12:53 PM