I'm trying to update 4 columns in my database where the UID matches, the query runs fine with no errors output but the database remains unchanged. The database is fully closed and nothing else has it open except the code. I'm quite new to using databases in code so I'm completely stumped at trying to find the error here.
The update query code is as a follows:
conn.Open();
OleDbCommand UpdateUserCMD = new OleDbCommand("Update Accounts_Info Set Unique_ID=@Unique_ID, Last_Login_Date=@Last_Login_Date, Last_IP=@Last_IP, Last_MAC=@Last_MAC" + " Where Unique_ID=@Unique_ID", conn);
UpdateUserCMD.Parameters.AddWithValue("@Last_Login_Date", DateTime.Now.ToString("yyyy.MM.dd_hh:mm:ss"));
UpdateUserCMD.Parameters.AddWithValue("@Last_IP", GetIPAddress(Dns.GetHostName()).ToString());
UpdateUserCMD.Parameters.AddWithValue("@Last_MAC", GetMACAddress());
UpdateUserCMD.Parameters.AddWithValue("@Unique_ID", TempGUIDHolder);
UpdateUserCMD.ExecuteNonQuery();
conn.Close();
The connection string is as follows:
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:/A-Level/Development/A_Level_AI_Project/A_Level_AI_Project/resources/Accounts.accdb");
Other query's work fine so i don't think its the connection string at fault.