I am trying to insert data into MS Access DB using Servelts (PreparedStatement) and HTML form.
Can some help me on the MS Acces Insert Query. My requirement is to insert form value into MS Access and also for one of the field during insert has to come from a different table.
So i have it this way:
insert into tablename(Col1, col2, col3)
values(?,?, select col3 from diffferent_table where name=col1))
Can i write it this way? I have to get the value of col3 from a different table depending on the input i get for Col1
Can someone please help.
One way of doing this would be:
If I were you, I would have done something along these lines:
I would then retrieve the value from the resultset by executing
retrieveStatementand set this value in theinsertStatementThe second option would help in case you need to handle specific scenario while inserting values from one table into another.
I guess you can follow this and come up with your own code