For starters, the include file should not be in two places ... that is asking for exactly this kind of problem.
Re the connect, note that you cannot connect to a database and access the database in the same procedure. You need to connect to the database and then run another program and access...