Requery problem in VB6 Data Environment

Requery problem in VB6 Data Environment

Post by Tom Van den Abbeel » Mon, 19 Jul 1999 04:00:00



I show the user different grids to get a view on their data. To access the
data I use an ODBC connection  that has been initialized in a data
environment. Besides viewing the data, the users must also have the
opportunity to modify it. To give this opportunity the locktype of the
datacommands in the data environment must be optimistic.

The problem is that after a requery on the recordset of the datacommand (to
give the user an other sortorder for ex.), the locktype of the recordset is
automatically set to read only and can only be turned back to optimistic
when the recordset is closed. And when I try to reach the same result by
closing and reopening the recordset, VB gives an error that says there is
already 'an object' open.

Is there someone who can give me the reason(s) of these problems or give me
an other possibility to give the users an other sortorder in their grids.

Any help would be welcome!

Thanks,

Tom

 
 
 

Requery problem in VB6 Data Environment

Post by Jack » Tue, 20 Jul 1999 04:00:00


Although it might not be the best solution, you can try binding your grid to
an ADO data control instead of the data environment. I generally only use
the data environment for read only purposes.



Quote:> I show the user different grids to get a view on their data. To access the
> data I use an ODBC connection  that has been initialized in a data
> environment. Besides viewing the data, the users must also have the
> opportunity to modify it. To give this opportunity the locktype of the
> datacommands in the data environment must be optimistic.

> The problem is that after a requery on the recordset of the datacommand
(to
> give the user an other sortorder for ex.), the locktype of the recordset
is
> automatically set to read only and can only be turned back to optimistic
> when the recordset is closed. And when I try to reach the same result by
> closing and reopening the recordset, VB gives an error that says there is
> already 'an object' open.

> Is there someone who can give me the reason(s) of these problems or give
me
> an other possibility to give the users an other sortorder in their grids.

> Any help would be welcome!

> Thanks,

> Tom


 
 
 

Requery problem in VB6 Data Environment

Post by Ijaz » Tue, 20 Jul 1999 04:00:00


I think this code help you

if de.rs.state=adstatopen then
    de.rs.close
endif
de.rs.open "your SQL"

ijaz


Quote:>I show the user different grids to get a view on their data. To access the
>data I use an ODBC connection  that has been initialized in a data
>environment. Besides viewing the data, the users must also have the
>opportunity to modify it. To give this opportunity the locktype of the
>datacommands in the data environment must be optimistic.

>The problem is that after a requery on the recordset of the datacommand (to
>give the user an other sortorder for ex.), the locktype of the recordset is
>automatically set to read only and can only be turned back to optimistic
>when the recordset is closed. And when I try to reach the same result by
>closing and reopening the recordset, VB gives an error that says there is
>already 'an object' open.

>Is there someone who can give me the reason(s) of these problems or give me
>an other possibility to give the users an other sortorder in their grids.

>Any help would be welcome!

>Thanks,

>Tom

 
 
 

1. Requery problem in VB6 Data Environment

I show the user different grids to get a view on their data. To access the
data I use an ODBC connection  that has been initialized in a data
environment. Besides viewing the data, the users must also have the
opportunity to modify it. To give this opportunity the locktype of the
datacommands in the data environment must be optimistic.

The problem is that after a requery on the recordset of the datacommand (to
give the user an other sortorder for ex.), the locktype of the recordset is
automatically set to read only and can only be turned back to optimistic
when the recordset is closed. And when I try to reach the same result by
closing and reopening the recordset, VB gives an error that says there is
already 'an object' open.

Is there someone who can give me the reason(s) of these problems or give me
an other possibility to give the users an other sortorder in their grids.

Any help would be welcome!

Thanks,

Tom

2. Order of execution of Constraints, Triggers and Rules

3. Data Environment Requery

4. upsizing to SQL

5. VB6 Data Environment problems w/ SQL 2000

6. Db-programm.: Which db/db-tool to use as a newbie?

7. VB6/SQL Server 7 problem - VB Data Environment

8. Any SAS users in here using ODBC?

9. VB6 Data Environment problems w/ SQL 2000

10. Data Environment problem in VB6 pro posting

11. Data Environment Problem in VB6 pro

12. Problems in Data Environment in VB6

13. VB6 Data Environment & Data Report