1. A programmable controller comprising: a communication interface configured to be connected to a database system; an instruction executing unit configured to execute a user program for controlling a control object, the user program including an access instruction, the instruction executing unit executing the access instruction to access the database system; and an access processing unit that controls the access to the database system via the communication interface by generating a database access statement according to the access instruction, wherein the programmable controller sets the access processing unit to operate in a first mode and a second mode based on an instruction included in the user program, the access processing unit switches to the one of the first mode and the second mode in accordance with a designation received via the communication interface, in the first mode, the access processing unit transmits the generated database access statement according to the access instruction to the database system using the communication interface and sends a result of a response of the database system to the database access statement to the user program, and in the second mode, the access processing unit sends an execution result corresponding to the generated database access statement to the user program without transmitting the database access statement to the database system to facilitate a debugging operation of the user program without communicating with the database system.