通过MS SQL 数据库SA帐号增加新用户至administrators组

作者:袖梨 2022-06-30
<%
'----数据库连接Start
  '---二级域名名称
  Main_Domain="web" '--域名格式为pcc.net
  dim conn_Home
  dim conn_Homestr
  '定义数据库类别,1为SQL数据库,0为Access数据库
  const IsSqlDataBase_Homestr = 1
  call conn_Home_init()
  sub conn_Home_init()
       if IsSqlDataBase_Homestr = 1 then
           ' 注此sql登陆需要有sa帐号和xp_cmdshell存储过程
      'sql数据库连接参数:数据库名、用户密码、用户名、连接名(本地用local,外地用IP)
      Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
      SqlDatabaseName = "Master"
      SqlPassword = "1"
      SqlUsername = "sa"
      SqlLocalName = "127.0.0.1"
      conn_HomeStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
      else
          DB = "/User_Database/DataBase/Shop_Manager.MDB" '---数据库路径
      conn_HomeStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db)
     end if
     Set conn_Home = Server.CreateObject("ADODB.Connection")
      on error resume next
         if err.number<>0 then
        err.clear
        set conn_Home=nothing
     Response.write "管理数据库连接出错!"
     Response.End
         else

相关文章

精彩推荐