In an application that uses classic asp, I have a key called connection:asp30
and another call connection:asp60
.
This application has several asp and other aspx pages.
I encrypted Web.config at the request of a client, use:
aspnet_regiis.exe -pef "appSettings" "D: \ Users \ rafael.barbosa \ Desktop \ Application-5.0" -prov "DataProtectionConfigurationProvider"
Okay.
.asp connections use connection:asp30
and .aspx connections use connection:asp60
When encrypted, the .aspx connections continued to run regularly, however .asp stopped working.
The .asp connection works as follows:
strConexao = GetXmlProp("connection:asp30", "")
gstrConn = strConexao
Set rst = Server.CreateObject("ADODB.Recordset")
Set rstConf = Server.CreateObject("ADODB.Recordset")
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open gstrConn
Being the function:
Function GetXmlProp(propName, stdvalue) Dim Node Dim cfgFile Dim fso
If IsEmpty(objXMLCfg) Or IsNull(objXMLCfg) Then
'determinar web.config
cfgFile = Session("ApplicationRootPath") & "\web.config"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(cfgFile) Then Response.Write "Atenção: arquivo " & cfgFile & " não encontrado." End If
Set fso = Nothing
Set objXMLCfg = Server.CreateObject("Microsoft.XMLDOM")
objXMLCfg.Async = False
objXMLCfg.Load(cfgFile)
End If
Set Node = objXMLCfg.documentElement.selectSingleNode("/configuration/appSettings/add[@key='" & propName & "']")
If Not Node Is Nothing Then
GetXmlProp = Node.getAttribute("value") Else
GetXmlProp = stdvalue End If
End Function
What can I do to make my Web.config understood and the application also access the database in the .asp layer?