#include "_SQL.au3"
Dim $ObjSQL, $server, $db, $username, $password
$server = "AS0091\SQLEXPRESS"
$db = "apn"
$username = "sa"
$password = "****"
$ObjSQL = _SQL_Startup()
$MsgSQL = _SQL_GetErrMsg()
ErrMsg($MsgSQL)
$OpenedDB = _SQL_Connect($ObjSQL, $server, $db, $username, $password)
$MsgSQL = _SQL_GetErrMsg()
ErrMsg($MsgSQL)
$Query1 = " GRANT ALTER ON [dbo].[zakazpost] TO [public] GRANT CONTROL ON [dbo].[zakazpost] TO [public] GRANT EXECUTE ON [dbo].[zakazpost] TO [public]"
_SQL_Execute($ObjSQL,$Query1)
If $MsgSQL = "" Then
MsgBox(0,"","Запрос выполнен",2)
Else
$MsgSQL = _SQL_GetErrMsg()
ErrMsg($MsgSQL)
EndIf
_SQL_Close($ObjSQL)
$MsgSQL = _SQL_GetErrMsg()
ErrMsg($MsgSQL)
Func ErrMsg($MsgSQL)
;$MsgSQL = _SQL_GetErrMsg()
$MsgSQLTemp = $MsgSQL
If $MsgSQLTemp <> "" Then
MsgBox(0,"",$MsgSQLTemp,2)
Exit
EndIf
EndFunc