日期:2014-05-17 浏览次数:20880 次
OleDbConnection msCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Program.Userset + @"\MySet.mdb;Jet OLEDB:Database Password=qwe");错误出现在
if (msCon.State == ConnectionState.Closed) msCon.Open();
string userSql = "select * from User where User=" + System.Environment.UserName + "order by User asc";//desc降序,asc升序
OleDbCommand msCmd = new OleDbCommand(userSql, msCon);
OleDbDataReader msRead = msCmd.ExecuteReader();
if (msRead.Read())
{
Program.Usergroup = (string)msRead["Group"];
OleDbDataReader msRead = msCmd.ExecuteReader();提示:Syntax error in FROM clause.
g userSql = "select * from User where User=‘" + System.Environment.UserName + "’ order by User asc";//desc降序,asc升序