Add new users to the administrators group using the ms SQL database SA account

Source: Internet
Author: User
Tags access database
<%
'---- Database connection Start
'--- Second-level domain name
Main_Domain = "web" '-- the domain name format is pcc.net
Dim conn_Home
Dim conn_Homestr
'Define the database category. The value 1 indicates the SQL database and the value 0 indicates the Access database.
Const IsSqlDataBase_Homestr = 1
Call conn_Home_init ()
Sub conn_Home_init ()
If IsSqlDataBase_Homestr = 1 then
'Note that this SQL logon requires the sa account and xp_mongoshell stored procedure.
'SQL database connection parameters: database name, user password, user name, and connection name (local for local use, IP for foreign use)
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" '--- DataBase path
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 "an error occurred while managing the database connection! "
Response. End
Else

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.