MS Access & ADO - Recordset needs reset 
Author Message
 MS Access & ADO - Recordset needs reset

If I open a recordset to be used in a for-next loop, I have to set the
recordset variable to nothing and recreate it for each loop because setting
the parameters won't change the parameter values after the execution of the
command.

This is only true for Access DB, works great for SQL Server and Oracle
without closing and reopening all the time.

Any ideas here?

pseudo code snip:

dim qd as adodb.command
dim rs as adodb.recordset

    set rs = cn.execute("open invoice item table")
    do until rs.eof
        if usingaccess then
            set qd = nothing
            set qd = (open the command)
        else (sql server and oracle)
            open the command if it's not already open
        end if
        with qd
            .parameters(0) = something
            .parameters(1) = something else
            .execute
        end with
        rs.movenext
    loop

NT or 98 or 95
Access 97
ADO 2.1



Sun, 27 Oct 2002 03:00:00 GMT  
 MS Access & ADO - Recordset needs reset
If I open a recordset to be used in a for-next loop, I have to set the
recordset variable to nothing and recreate it for each loop because setting
the parameters won't change the parameter values after the execution of the
command.

This is only true for Access DB, works great for SQL Server and Oracle
without closing and reopening all the time.

Any ideas here?

pseudo code snip:

dim qd as adodb.command
dim rs as adodb.recordset

    set rs = cn.execute("open invoice item table")
    do until rs.eof
        if usingaccess then
            set qd = nothing
            set qd = (open the command)
        else (sql server and oracle)
            open the command if it's not already open
        end if
        with qd
            .parameters(0) = something
            .parameters(1) = something else
            .execute
        end with
        rs.movenext
    loop

NT or 98 or 95
Access 97
ADO 2.1



Tue, 29 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SQL Help Needed - ADO & MS Access

2. saving ado recordset to MS Access database

3. Help needed with connection for recordset in MS Access

4. Can't reset commandtext for recordset in dataenvironment using ADo

5. Need help: jpegs, vb4, & ms access

6. Help with Access ADO recordset needed

7. ADO ,MS Access and MS Excel

8. MS Access & MS Word Automation/Security Issue

9. ADO ,MS Access and MS Excel

10. accessing MS access database using VB&CGI

11. Accessing Usernames in Ms Access 97 Using ADO

12. Using ADO to access MS Access

 

 
Powered by phpBB® Forum Software