Skip to content

Error: Access is denied. (os error 5) #374

Answered by jmacak-at-dl
jmacak-at-dl asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you so much for taking the time to respond!

I am able to create a file in the outPath directory as the same user. Also, changing the outPath to a different location (I tried simply the Documents folder) resulted in the same error.

However, literally as I was trying to collect information for this comment, I got the script into a working form, and I think I've been able to isolate the issue.

Here's the full script:

$driver = 'ODBC Driver 17 for SQL Server'
$user = 'user'
$password = 'pass'
$server = 'server'
$db = 'database'
$table = 'table'

$query = "SELECT * FROM $table"
$outpath = "E:/DataPull/ParquetFiles/$db/$table"

$connStr = "Driver={$driver};Server=$server;UID=$user;PWD=$pa…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@jmacak-at-dl
Comment options

Answer selected by pacman82
@pacman82
Comment options

@jmacak-at-dl
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants