Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO Recordset.Find versus Recordset.Open
Message
De
14/08/2000 10:55:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00404383
Message ID:
00404524
Vues:
12
Hi John,

Thanks for the perspective. In this case, SELECT * doesn't bother me because they are lookup tables with no more than 20 rows apiece and no more than 3 columns per table.

Here's the situation: I have no control over the SPs of the database because I have been flat out told that the DBA will not allow new SPs. I have an incoming ASCII file. The file has about 10 foreign keys per row that may or may not be valid so I have to lookup each one of them. I expect no more than 200 rows.

When running this in a loop with .Open("SELECT * FROM table WHERE pk = &cFK"), the application is bogging down tremendously. This is why I was thinking of using the .Open("SELECT * FROM table") before beginning the loop and then using .FIND("pk = &cFK"). Would the reduced IO be faster?

>>>Open("SELECT * from table")
>
>This never scales. First off, Select * is bad practice. Second, what happens when you start getting 1000, 2000 or more rows...




>
>>>.Open("SELECT * FROM table WHERE pkey = 1111")
>
>
>Certainly better
>
>>I ask this in the context of a lookup table that needs to be hit up about 100 times in a big loop. Right now, everything is "Open" where I SELECT for the single key and I'm thinking of changing that if some benefit will be derived by opening the entire table all at once and using Find in the loop.
>>
>>It's a big programming task and I was looking for some informed opinions first.
>>
>
>
>If you are using SQL Server, why don't you do these sort of operations in a stored procedure. What exactly are you trying to accomplish? Are you looking to return a result set? Or, are you looking to update data? If it is all data driven, I ask again why not do this sort of thing in a stored proc since there is most likely, not a need to return records to a client.
>
>
>In reality, this issue has nothing to do with ADO per-se...
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform