QT, which was released interface, how to add the user to the database

This is a publishing task interface, which of the following is the view interface, I mean the user login, publish the task does not appear in the user interface, and then view, is blank publisher releaser output, how to publish the task, together with the binding name, then the output is displayed?


Part of the code:

//This is the slot function the send button release task interface.

void releaseTask::on_pushButton_clicked()
{
query->prepare("insert into task(releaser,receiver,project,project_info,releaseDate,taskData) values(?,?,?,?,?)");

query->bindValue(0,ui->comboBox_Receiver->currentText());
query->bindValue(1,ui->comboBox_Project->currentText());
query->bindValue(2,ui->textEdit_taskinfo->toPlainText());
query->bindValue(3,ui->dateEdit_StartDate->date());
query->bindValue(4,ui->dateEdit_EndDate->date());

if(query->exec())
{
QMessageBox::about(this,"Tips "," task successfully posted! "); //," \ "" + ui-> lineEdit-> (text) + "\" added successfully");
}
else
{
QMessageBox::warning(this,"Tips "," task already exists´╝ü",QMessageBox::Yes);
}
qDebug() <<query->lastError().text();
query->clear();
this->close();
}

Started by Austin at November 16, 2016 - 5:06 AM

Add more trouble in the program, then write a memory to add

One, new user and authorization

The new password for account appuser, 163.com, and allows the user to the appdb database test table has a select, insert, update permissions, then followed by the implementation of
exec sp_addlogin 'appuser','163.com','TEST' 
go 

use TEST 
exec sp_grantdbaccess 'appuser' 
go 

use TEST 
grant select,insert,update 
on test 
to appuser 
go

 

If want to add the role of db_owner, so

USE test;
exec sp_addrolemember 'db_owner', 'test'
go

Posted by Lena at November 18, 2016 - 5:41 AM

User login, automatic access to the username, and the preservation of global variables in public.

Release the task interface click publishing, writing data table, incidentally, user name written inside.

The interface will be naturally release of information.

Posted by Marvin at November 24, 2016 - 6:20 AM