missing operator

i am using database in my game the query is giving an error of missing operator my code is

public void Execute(){

jsScript = Camera.main.GetComponent();
ReadStudent(Application.dataPath+“/dictionary.accdb”,“dict”,“word”,“word”,“=”,jsScript.words);

}

internal void ReadStudent(string filetoread,string tableName, string itemToSelect, string wCol, string wPar, string wValue){

  string connection = "Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=" + filetoread;
  Debug.Log(connection);

    string sqlQuery ="SELECT word FROM"+ tableName +"WHERE" + wCol + wPar+"'"+wValue+"";

    OdbcConnection con = new OdbcConnection(connection);
    OdbcCommand cmd = new OdbcCommand(sqlQuery,con);
    DataTable dt = new DataTable("dic");


    try{
        con.Open();
        OdbcDataReader reader = cmd.ExecuteReader();
        dt.Load(reader);
        reader.Close();
        con.Close();
    }

    catch (Exception ex){
     //text = dt.Rows[3][1].ToString();
        Debug.Log(ex.ToString());
    }

    finally{
        if (con.State!=ConnectionState.Closed){
            con.Close();
        }
        con.Dispose();
    }

    if (dt.Rows.Count>0){
            text = dt.Rows[0]["word"].ToString();
    }

}

it is giving error :
System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'word FROMdictWHEREword=‘MX’.

I don’t know how exactly works Microsoft Access SQL but check the query :

“SELECT word FROM”+ tableName +“WHERE” + wCol + wPar+“'”+wValue+“”;

You’re forgetting some blank spaces , the query should be like this:
“SELECT word FROM “+ tableName +” WHERE " + wCol + wPar+”'“+wValue+”";

And maybe the part after the WHERE clause is also wrong.

Besides the missing spaces, it seems you’re missing the closing "'" behind wValue in your query. Also itemToSelect is not used in the query string as column (that’s not an immediate problem since you even pass “word”, but if you want to use this function in a week you don’t remember this and probably wondering what’s wrong :wink: )