ASP/ASP.NET站点连接数据库的配置文件

一般为Conn.asp、Web.Config(一般在站点根目录)
这些配置文件一般都含有数据库连接字符串。
例如:
Conn.asp内的连接字符串为

set Conn=server.CreateObject(“ADODB.CONNECTION”)
StrConn=”Provider=SQLOLEDB;Data Source=127.0.0.1,1433;User ID=数据库用户名;Password=数据库密码;
Initial Catalog= 数据库名称“
Conn.open StrConn

Web.Config内的连接字符串为

providerName=”System.Data.SqlClient”/>

实践

Trusted_Connection=True Windows凭据对SQL Server进行身份验证

<?xml version="1.0" encoding="utf-8"?>
<connectionStrings>
  <add name="SqlServer" connectionString="Data Source=localhost;Initial Catalog=TJNiuShang;Trusted_Connection=True" providerName="System.Data.SqlClient" />
  <add name="MySql" connectionString="data source=.;initial catalog=BensBaseNew;user id=sa;password=123456" providerName="MySql.Data.MySqlClient" />
  <add name="Oracle" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.210)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=TEST;Password=TEST123" providerName="System.Data.OracleClient" />
</connectionStrings>
<connectionStrings>
  <add name="ConnectString_Local" connectionString="server=.;uid=sa;pwd=ps5u49It^znAWZS0;database=qds160626112;"/>
  <!--WHZF012411\NSWMSSQL-->
  <!--xbjcsxm8_db-->
  <!--<add name="ConnectString_Local" connectionString="server=.;uid=sa;pwd=sa;database=xbjcsxm8_db;"/>--><!--xbjcsxm8_db-->
</connectionStrings>

SQL server 身份验证

<?xml version="1.0" encoding="utf-8"?>
<connectionStrings>
  <add name="SqlServer" connectionString="Data Source=qds11111111.my3w.com;Initial Catalog=qds11111111_db;User ID=qds11111111;Password=vDrC&U0n;" providerName="System.Data.SqlClient" />
  <add name="MySql" connectionString="data source=.;initial catalog=BensBaseNew;user id=sa;password=123456" providerName="MySql.Data.MySqlClient" />
  <add name="Oracle" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.210)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=TEST;Password=TEST123" providerName="System.Data.OracleClient" />
</connectionStrings>

实践

ACCESS 数据库密码修改
admin---加密---c868a64eabe1126d5b514afcf8dda46b17f