My code is below. I've got a method where I pass in three parameters plus they get written to an MS Access database table. However, I keep obtaining a syntax error message. Can anybody let me know why? I acquired this situation from the web.

        private static void insertRecord(string day, int hour, int loadKW)
        string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\LoadForecastDB.accdb";
        OleDbConnection conn = new OleDbConnection(connString);

        string ins = @"INSERT INTO Forecasts (Day, Hour, Load) VALUES (?,?,?)";

        OleDbCommand cmd = new OleDbCommand(ins, conn);

        cmd.Parameters.Add("@day", OleDbType.VarChar).Value = day;
        cmd.Parameters.Add("@hour", OleDbType.Integer).Value = hour;
        cmd.Parameters.Add("@load", OleDbType.Integer).Value = loadKW;


            int count = cmd.ExecuteNonQuery();
        catch (OleDbException ex)

I believe this may be since your column names (Day and Hour) will also be key phrases. Maybe place the ` (inverted single quotes) around them (that actually works in MySQL, haven’t heard of MS Access)

Try altering

string ins = @"INSERT INTO Forecasts (Day, Hour, Load) VALUES (?,?,?)"; 


string ins = @"INSERT INTO Forecasts ([Day], [Hour], [Load]) VALUES (@day, @hour, @load)"; 

An alternative choice may be to touch on bind variables with amounts:

    cmd.Parameters.Add(1, OleDbType.VarChar).Value = day;
    cmd.Parameters.Add(2, OleDbType.Integer).Value = hour;
    cmd.Parameters.Add(3, OleDbType.Integer).Value = loadKW;

Note I don't know C#, but similar approach works best for Java and JDBC.