如何在Visual Studio C ++中的Access数据库中插入

时间:2019-01-04 18:21:04

标签: visual-c++

我需要使用c ++插入Visual Studio中的Access数据库

OleDbConnection ^ conDataBase = gcnew OleDbConnection(“ Provider = Microsoft.ACE.OLEDB.12.0;数据源= E:\ visual studio \ Pr6 \ Pr \ CData.accdb”);                 conDataBase-> Open();

            OleDbCommand^cmdDataBase = gcnew OleDbCommand("INSERT INTO Table1 (USERNAME,FIRSTNAME,LASTNAME,AGE,PASSWORD) VALUES ('" + this->UN->Text + "','" + this->FN->Text + "','" + this->LN->Text + "','" + this->A->Text + "','" + this->PS->Text + "')", conDataBase);
            conDataBase->Close();

0 个答案:

没有答案