Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > ADO Data > Filter Property...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4183 of 4320
Post > Topic >>

Filter Property with ADO, VB6 and SQL extremely slow

by =?Utf-8?B?SmltIE9saXZlcg==?= <Jim Oliver@[EMAIL PROTECTED] Mar 13, 2008 at 02:26 PM

Hello all,

I have found many references to this issue but no answer.  I have a table 
with approximately 1,000,000 records.  I need to find 1 record by the
primary 
key.  I have tried many things, but the only thing that seems to work is 
ADO's filter property.

The .Find property won't work because the primary key has more than one
field.

The .Seek property isn't sup****ted under SQL Server.

But the .Filter property takes an enourmous amount of time (I don't know
how 
much yet, as it has not yet returned the record.)

The code is basically this:

CON.Open "Provider=SQLOLEDB.1;Server=TheServer;Database=TheDatabase"
RS.Open TableName, CON, nRSCursorMode, nRSLockMode, adCmdTableDirect
RS.Filter = "field1='abc' AND field2='def'"

I have tried many combinations of cursor mode & Lock mode, with no 
improvement.  I have also tried using a command object, again with no
help.

How do I find a record with the primary key using ADO on a SQL Server 
database?  Surely it shouldn't take hours just to return 1 record.  I
could 
understand if the fields weren't the primary key, but in this case the key

consists exactly of "field1" and "field2".  Shouldn't SQL Server just look
up 
the values on the key and return the record?

Isn't there some way to simulate the .Seek method in SQL Server?  If I
can't 
do it through ADO, can I do it using direct calls to SQL Server, and if
so, 
how?

thanks
 




 2 Posts in Topic:
Filter Property with ADO, VB6 and SQL extremely slow
=?Utf-8?B?SmltIE9saXZlcg=  2008-03-13 14:26:01 
Re: Filter Property with ADO, VB6 and SQL extremely slow
"Bob Barrows [MVP]&q  2008-03-13 17:52:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:00:15 CST 2008.