Recently did a host computer project, met a lot of problem points, has no time to summarize. Now the project is over, to summarize, all through the network to find data to solve. Thanks again to those seniors, once again to do a record, convenient peer reference, but also convenient for their own later view.
The interface is as follows:
One: Problem point, do when the user logged on: "" is not registered on the local computer microsoft.ace.oledb.12.0 provider "" the Bullet Box error.
Here is the code
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingmoudelii;namespacetemplate{ Public Partial classFrmlogin:form { PublicFrmlogin () {InitializeComponent (); } Private voidButton1_Click (Objectsender, EventArgs e) { Try { stringuser =TextBox_UserName.Text.Trim (); stringPWD =TextBox_Password.Text.Trim (); if(User = ="") || (pwd = ="") {MessageBox.Show ("The user name or password is wrong! "); return; } //string strconn = "Provider=microsoft.ace.oledb.4.0;data source=" + Application.startuppath + @ "\DB_USERMSG.ACCDB" ; //modaccess access = new Modaccess (strconn); stringsql ="SELECT * from Tbuserinfo where username= '"+ user +"' and password= '"+ pwd +"'"; DataTable DT=ComData.dbUser.ExecuteDataTable (SQL); if(dt. Rows.Count >0) {Comdata.userlevel= Convert.ToInt32 (dt. rows[0]["UserLevel"]); Comdata.username= dt. rows[0]["UserName"]. ToString (). Trim (); MessageBox.Show ("Login Successful! "); This. Hide (); } Else{MessageBox.Show ("The user name or password is wrong! "); } } Catch(Exception ex) {MessageBox.Show (ex). Message); } } Private voidTextbox_password_keypress (Objectsender, KeyPressEventArgs e) { if(E.keychar = ='\ r') {button1_click (sender, E); } } }}
Public Static new modaccess ("provider=microsoft.ace.oledb.12.0;data source="@ " \db_usermsg.dat
User and password, save to:
Db_usermsg.dat's file inside.
In the development of the computer without error, but copied to the device host computer will be reported: "" is not registered on the local computer microsoft.ace.oledb.12.0 provider "". The error prompt.
Second: The solution: https://q.cnblogs.com/q/43682/ found this predecessor's blog, through his method can be resolved, again express thanks.
Download link Address
Http://download.microsoft.com/download/7/0/3/703ffbcb-dc0c-4e19-b0da-1463960fdcdb/AccessDatabaseEngine.exe
Will download the
The software can be installed to the computer to solve.
The microsoft.ace.oledb.12.0 provider is not registered on the local computer