Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ADODB Connection open method is too slow

Author  Topic 

fireali
Starting Member

2 Posts

Posted - 2005-08-13 : 01:39:27
Hi everybody!
I got a problem with this code(VB 6):

Dim Cnn as New ADODB.Connection
Dim Rs as New ADODB.Recordset
Cnn.Open "Driver=Sql Server;DATABASE=mydb;Server=10.0.0.1", "usr", "pass"
Sql = "SELECT * FROM myTable where ..."
Rs.Open Sql,Cnn,1,3

Although this code works, but it's too slow(my recordset only includes 15 records), it takes about 1 or 2 minutes to execute. I think it's all about the Cnn.Open method. How can I overcome this problem?
Thanks,
Ali.

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-08-13 : 11:15:28
You say your recordset only has 15 records but how many does your table have? How long does the query take on its own?


steve

Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.
Go to Top of Page

Stalker
Yak Posting Veteran

80 Posts

Posted - 2005-08-14 : 00:43:41
>>How long does the query take on its own?

yeah, did you try to run your query in QA ?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-16 : 02:27:59
Did you use index for the key column?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -