locked
ASP.Net error ERROR [HY024] when ODBC tries to access a mapped network drive RRS feed

  • Question

  • User1957187619 posted

    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.

    Tuesday, July 15, 2014 3:29 PM

Answers

  • User-1454326058 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 22, 2014 4:44 AM

All replies

  • User-1454326058 posted

    Hi,

    You should to check the application pool’s Identity user.

    1. Right click the application pool=>Advanced Settings..
    2. Check Identity in Process Model section.

    You need to grant that user to have enough permission to access network drive.

    Thanks

    Best Regards

    Wednesday, July 16, 2014 4:16 AM
  • User1957187619 posted

    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.

    Monday, July 21, 2014 8:12 AM
  • User-1454326058 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 22, 2014 4:44 AM
  • User1957187619 posted

    I've tried to use the machine admin account and it worked fine!

     

    Thanks.

     

    Monday, July 28, 2014 10:36 AM