When my Asp.Net application running on IIS tries to access an ODBC connection pointing to a mapped network drive, I get the following error:
ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr
failed
But, if I run my asp.net page via debugging using Visual Studio 2010, the connection works. So the problem seems to be some user restriction to the mapped network drive.
I've already tried to disable UAC on my machine and it didn't work.
The Identity was marked as "LocalService". I tried the "NetworkService" and grant full access to the network directory, restarted the IIS but the error still occurs:
ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr
failed ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Member
1 Points
3 Posts
ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive
Jul 15, 2014 03:29 PM|fernandolorenzon|LINK
When my Asp.Net application running on IIS tries to access an ODBC connection pointing to a mapped network drive, I get the following error:
ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
But, if I run my asp.net page via debugging using Visual Studio 2010, the connection works. So the problem seems to be some user restriction to the mapped network drive.
I've already tried to disable UAC on my machine and it didn't work.
This thread didn't help either:
http://forums.asp.net/t/1947894.aspx?ERROR+HY024+Microsoft+ODBC+Text+Driver+unknown+is+not+a+valid+path
I'm running the project on two Windows 2012 servers. In one of them the error occurs, and in the other one it works fine.
I've already tried to give permission to the IUSR on the mapped directory and it didn't work.
odbc networkdirectory
All-Star
23975 Points
4084 Posts
Re: ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive
Jul 16, 2014 04:16 AM|Starain chen - MSFT|LINK
Hi,
You should to check the application pool’s Identity user.
You need to grant that user to have enough permission to access network drive.
Thanks
Best Regards
odbc networkdirectory
Member
1 Points
3 Posts
Re: ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive
Jul 21, 2014 08:12 AM|fernandolorenzon|LINK
The Identity was marked as "LocalService". I tried the "NetworkService" and grant full access to the network directory, restarted the IIS but the error still occurs:
ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [HY024] [Microsoft][ODBC Text Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
odbc networkdirectory
All-Star
23975 Points
4084 Posts
Re: ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive
Jul 22, 2014 04:44 AM|Starain chen - MSFT|LINK
Hi,
Please try to specify a specific account and try again (Custom account).
On the other hand, please check the setting of Application pool whether there are some different, which the website works fine (Windows server 2012)
Thanks
Best Regards
odbc networkdirectory
Member
1 Points
3 Posts
Re: ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive
Jul 28, 2014 10:36 AM|fernandolorenzon|LINK
I've tried to use the machine admin account and it worked fine!
Thanks.
odbc networkdirectory