Connection Object's Execute Metthod (ADO) Only works on Debug Mode

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using Access 2002 on Windows XP. I have a strange problem!, need your
expert advise. I have written a Module to manipulate data and write into
another table. The module is compiled and work fine when I run the code in
debug mode. However, when the same code run on run-time (without debug mode),
it does not work. The Insert Query triggered using Connection object's
Execute method fails.

Could anyone know why this happens and help asap.

Thanks
Regards
K.S.Jaishankar
 
Hi,

Found an alternative that works. Just for info to all of you;

Set cnnDB = currentproject.connection
cnnDB.execute strSQL
OR 'Opening Recordset
rstIR.open strSQL, cnnDB

The above method(s) does not work in most of the cases. The alternative is;
using command object with connection set to currentproject.connection
and for recorset
rstIR.open strSQL, currentproject.connection

Hope this is useful to all. However, I am not able identify why cnnDB method
does not work.

Regards
K.S.Jaishankar
 
Back
Top