Am I missing something silly here?
String update = "UPDATE Patients SET fullName = '" + patient.getName() + "',
houseNum = '" + patient.getHouseNum() + "',
address = '" + patient.getAddress() +"',
postCode = '" + patient.getPostCode() + "',
condition = '" + patient.getCondition() + "',
who = '" + patient.getWho() + "',
time = '" + patient.getTime() + "',
location = '" + patient.getLocation() + "',
actionTaken = '" + patient.getActionTaken() + "',
duration = '" + patient.getDuration() + "'
WHERE regNo = '" +patient.getNHSnum()+"'";
For the sake of it, I returned on each new line for formatting here. Within my file it's on a single line. All database fields are of type text.
The error I get is:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement. -3503
EDIT:
For info, the following works ok:
String update = "UPDATE Patients SET fullName = '" + patient.getName() + "',
houseNum = '" + patient.getHouseNum() + "',
address = '" + patient.getAddress() +"',
postCode = '" + patient.getPostCode() + "',
condition = '" + patient.getCondition() + "'
WHERE regNo = '" +patient.getNHSnum()+"'";
EDIT2:
Here is the update string in full:
UPDATE Patients SET fullName = 'Dave', houseNum = '5', address = 'Bla', postCode = 'PQ1 RS2', condition = 'Unknown', who = 'Test', time = 'Test1', location = 'Test2', actionTaken = 'Test3', duration = 'Test4' WHERE regNo = '1'
As I said, in this example, every field in the database is of type text
PreparedStatement...patientobject?update..