I have this error when I trying to connect ASP Classic web app (hosted in IIS 10) to SQL Server 2014 with username and password using a DSN configured in IIS dockerfile:
Microsoft OLE DB Provider for ODBC Drivers error '80040e4d' [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'sa'. I can login to 'sa' account using SSMS, but not from ASP Classic web app with the same credentials.
The environment is configured in 2 Docker containers, these are the 2 dockerfiles:
SQL Server Dockerfile
FROM microsoft/windowsservercore:1803 # Download Links: ENV exe "https://go.microsoft.com/fwlink/?linkid=840945" ENV box "https://go.microsoft.com/fwlink/?linkid=840944" ENV SA_PASSWORD="Password~1234" \ attach_dbs="[]" \ ACCEPT_EULA="Y" \ SA_PASSWORD_path="C:\ProgramData\Docker\secrets\sa-password" SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # make install files accessible COPY start.ps1 / WORKDIR / RUN Invoke-WebRequest -Uri $env:box -OutFile SQL.box ; \ Invoke-WebRequest -Uri $env:exe -OutFile SQL.exe ; \ Start-Process -Wait -FilePath .\SQL.exe -ArgumentList /qs, /x:setup ; \ .\setup\setup.exe /q /ACTION=Install /INSTANCENAME=MSSQLSERVER /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\NETWORK SERVICE' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS ; \ Remove-Item -Recurse -Force SQL.exe, SQL.box, setup RUN stop-service MSSQLSERVER ; \ set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql14.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value '' ; \ set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql14.MSSQLSERVER\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433 ; \ set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql14.MSSQLSERVER\mssqlserver\' -name LoginMode -value 2 ; HEALTHCHECK CMD [ "sqlcmd", "-Q", "select 1" ] CMD .\start -SA_PASSWORD $env:SA_PASSWORD -ACCEPT_EULA $env:ACCEPT_EULA -attach_dbs \"$env:attach_dbs\" -Verbose IIS Dockerfile
FROM microsoft/iis SHELL ["powershell", "-command"] ENV USER_NAME="iisadmin" ENV USER_PASSWORD="Password~1234" RUN Install-WindowsFeature Web-ASP; RUN Install-WindowsFeature Web-CGI; RUN Install-WindowsFeature Web-ISAPI-Ext; RUN Install-WindowsFeature Web-ISAPI-Filter; RUN Install-WindowsFeature Web-Includes; RUN Install-WindowsFeature Web-HTTP-Errors; RUN Install-WindowsFeature Web-Common-HTTP; RUN Install-WindowsFeature Web-Performance; RUN Install-WindowsFeature WAS; RUN Import-module IISAdministration; # setup Remote IIS management RUN Install-WindowsFeature Web-Mgmt-Service; \ New-ItemProperty -Path HKLM:\software\microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force; \ Set-Service -Name wmsvc -StartupType automatic; # Add user for Remote IIS Manager Login RUN net user $env:USER_NAME $env:USER_PASSWORD /ADD; \ net localgroup administrators $env:USER_NAME /add; # Temporal folder for installations files RUN md c:/msi; RUN Invoke-WebRequest 'http://download.microsoft.com/download/C/9/E/C9E8180D-4E51-40A6-A9BF-776990D8BCA9/rewrite_amd64.msi' -OutFile c:/msi/urlrewrite2.msi; RUN Start-Process 'c:/msi/urlrewrite2.msi' '/qn' -PassThru | Wait-Process; RUN Invoke-WebRequest 'https://download.microsoft.com/download/1/E/7/1E7B1181-3974-4B29-9A47-CC857B271AA2/English/X64/msodbcsql.msi' -OutFile c:/msi/msodbcsql.msi; RUN ["cmd", "/S", "/C", "c:\\windows\\syswow64\\msiexec", "/i", "c:\\msi\\msodbcsql.msi", "IACCEPTMSODBCSQLLICENSETERMS=YES", "ADDLOCAL=ALL", "/qn"]; EXPOSE 8000 RUN Remove-Website -Name 'Default Web Site'; RUN md c:\mywebsite; RUN New-IISSite -Name "mywebsite" -PhysicalPath 'c:\mywebsite' ` -BindingInformation "*:8000:"; RUN & c:\windows\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/asp RUN & c:\windows\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/handlers RUN & c:\windows\system32\inetsrv\appcmd.exe unlock config /section:system.webServer/modules RUN c:\windows\system32\inetsrv\appcmd.exe set config "mywebsite" -section:system.webServer/asp /scriptErrorSentToBrowser:"True" RUN Add-OdbcDsn -Name "mywebsite" -DriverName "\"ODBC Driver 13 For SQL Server\"" -DsnType "System" -SetPropertyValue @("\"Server=172.20.0.4\"", "\"Trusted_Connection=No\""); WORKDIR c:\\mywebsite