Home > database >  Under PB can be programmed to add or delete a user name SQL2000 database, such as the SA
Under PB can be programmed to add or delete a user name SQL2000 database, such as the SA

Time:09-27

Under PB can be programmed to add or delete a user name SQL2000 database, such as the SA

CodePudding user response:

dingding

CodePudding user response:

There is no solution?

CodePudding user response:

You write from the query analyzer grammar
To the pb deposit a string
With a user is sa, the autocommit=true dynamic to try the execution of the transaction object

CodePudding user response:

May have to call with the master of the stored procedure sp_addlogin, sp_adduser, sp_droplongin, sp_dropuser.

CodePudding user response:

String ls_sql
Ls_sql="sp_addlogin 'sa_test', 'sa_test', 'master'"//add server user
The sqlca. The autocommit=true
The execute IMMEDIATE: ls_sql;
If the sqlca. Sqlcode<> 0 then
Messagebox (string (sqlca sqlcode), the sqlca. Sqlerrtext)
End the if
Ls_sql="EXEC sp_addsrvrolemember 'sa_test', 'sysadmin'" added to the dba in//
The execute IMMEDIATE: ls_sql;
If the sqlca. Sqlcode<> 0 then
Messagebox (string (sqlca sqlcode), the sqlca. Sqlerrtext)
End the if
The sqlca. The autocommit=false

CodePudding user response:

Sa as if can't delete it, didn't try
You can add or delete your defined by the user

CodePudding user response:

Learning. Help
  • Related