We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

sql to ado.recordset very slow

Medium Priority
1,878 Views
Last Modified: 2012-08-14
I'm using ado object in VB6 with an sql recordset. My code is:

Set RSord = New ADODB.Recordset
RSord.Source = "select * from Orders where IDOrder = " & strIDord
RSord.Open

Opening the recordset it is very fast.
But after the following instruction:

Set frm.AdOrd.Recordset = RSord

this is very very slow.

Any ideas?

Thanks in advance for any suggestion.
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2012

Commented:
How big is the resultset?
Can you try specifying other parameters in the connection string? e.g. batch optimistic, etc. This would avoid locking and its especially important if it is a huge dataset.
Also, what are you doing after setting the recordset? If it is going to be open for a longer duration, yo are better off getting the data and disconnecting it and again connecting when needed.

Author

Commented:
The resultset is around 30 fields.
the ADODC object it used to populate textboxes on a form.

I'll try to use other parameters (batch optimistic etc.) but I'm using the same object, same code, same server with SQL server 2005 installed, on other application with no problems.

Could be a firewall or other restriction on the network?
Many thanks.
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>The resultset is around 30 fields.<<
I mean how many rows.

Author

Commented:
Only one rows.
SQL SERVER EXPERT
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I will check all suggested issues.

Thanks a lot.

Donatella
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.