ADO Command object in a Loop

S

solex

I have a problem with a stored procedure call that occurs in a loop. I
initialize both the stored procedure and it's set of parameters before
entering the loop using the ADO.Command object and its parameter collection.
Inside the loop I set the parameters and then execute the procedure.

The problem I am having is the parameters do not seem to take on the
appropriate values after the first iteration of the loop. The inital values
of the parameters in the first iteration of the loop are the values that
remain regardless of how many times the loop is iterated.

The values I am sending differ greatly so it is not a data issue, I ported
the exact code to VB and executed the command and it works perfectly it
appears to be a problem within Access 2K VBA.

Has anyone else had this problem?

Regards,
Dan
 
S

SA

Dan:

Check the version of the MDAC library that is both on your system and that
is referenced by Access 2000. By default A2K references ADO version 2.1,
which is old and some what buggy in our experience in working with
parameters and properly refreshing the collection etc. If you haven't
downloaded MDAC 2.8 (which contains the ADO libraries), which the latest
version, you can do that from MS' web site. Then update your reference in
the db to ADO 2.7 or greater type library (ADO 2.7 was the base on Windows
Xp, 2.5 on Windows 2000, 2.1 with Access 2000).
 
S

solex

Steve,

Thanks for your response but both implementations are using ADO 2.7.

Regards,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top