0
In an application that uses classic Asp, I have a key called connection:asp30
and another call connection:asp60
.
This application has several pages Asp and other aspx.
I encrypted Web.config at the request of a client, use:
aspnet_regiis.exe -Pef "appSettings" "D: Users rafael.Desktop Application - 5.0" -Prov "Dataprotectionconfigurationprovider"
OK.
The connections of . Asp use the connection:asp30
and the . aspx connections use the connection:asp60
When encrypting, the connections of . aspx continued to work regularly, however, the . SP stopped working.
The connection of . Asp 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 access the database in the layer . Asp ?
The safest way would be to create a database class in your application to manipulate its sql, there you would create rules, you could create a list with your connections and via programming they would be triggered.
– bp002