Information générale
Catégorie:
Contrôles ActiveX
>HI,
>I need to display 35K rows of 75 fields each for validation process to a user. My backend is Oracle and I access it through ADO. Everithing is fine but when I load my form, it takes 1-2 mins to show up and when the user is scrolling the datagrid, it takes 5 secs before it scrolls. I do know that the problem is related to the 35K rows I am loading so I tried to limit the number of rows.
>
>I issue "SELECT * FROM MyOracleTable WHERE ROWNUM < 100" and it retreives me the first 99 rows. When I want to issue this through a command object, I send two parameters in order to have a sql string like this :
>"SELECT * FROM MyOracleTable WHERE ROWNUM >firstparameter and < secondparameter"
>
>However, I get an error message from the grid when I want to set Mygrid.datasource = MyRst telling me that the cursor is not bookmarkable.
>
>Do I need to use another ActiveX control or is there something I should change in my logic ?
>
>Thank you for your help,
>Christian Cote
For speeding up the query, take a look at the Cachesize property of the recordset object. The default size is 1 (or at least it was with 2.1), you should test with a higher setting, like 50 or 100 to see if that speeds things up a bit.
For the datagrid problem, there is a workaround for the problem described in the KB article Eric mentions. Check if the recordset supports bookmarks by using the Supports method and if it does not then persist it to disk, close the original recordset and open the disk one. This should open the recordset as static and you will be able to assign it as a datasource.
You can see VFP code for the Datagrid workaround by downloading the "ADOBrowse" file in the files section (VFP forum). You can easily translate to VB code if you choose to go this way.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement