Use
parametrized query[
^]:
sql_2 = "PARAMETERS [editdate] DATE; SELECT * FROM tblBookings WHERE LessonDate = #[editdate]# ORDER BY LessonDate DESC;"
How to use it?
You need to use
OledbCommand[
^] with
parameters[
^]. Follow the links for sample code.
Note that
OledbCommand
usually uses no-named parameters, but MS Access database can use named parameters.