Solved

Fill datagrid from stored procedure without using recordset (SQLServer 7 / VB6)

Posted on 2004-04-19
2
1,997 Views
Last Modified: 2013-12-25
I wrote a VB6 application, which reads data from a SQLServer 7 database into a datagrid. Some columns are updated by the user and written back to the DB.
I fill the datagrid in the following way:
  Dim...
  sql = "Select..."
  Set rec = New Recordset
  rec.CursorLocation = adUseClient
  rec.Open sql, DataEnvironment1.Connection1, adOpenStatic, adLockOptimistic
  Set DataGrid1.dataSource = rec

The Win2K clients are connected to the database server via a 256KB line. Current response times are 1-3 seconds for standard queries, but can go up to half a minute. I would like to speed up the application and fill the datagrid straight from a SP without using a recordset (similar to SQLAdapter in .NET). Does anybody know how to do this?
0
Comment
Question by:TKL1960
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 250 total points
ID: 10857731
Hi TKL1960,

This could be tricky, you could elect to use a server-side cursor rather than client-side but you still need to use a recordset. Even the SQLDataAdapter does this really, just exposes a different set of methods for working with it. The only bindable object to a datagrid is a recordset object so unless you can improve your storedproc in such a way as perhaps to return fewer records or even play with the page size etc to only load a few records at a time into the grid you aren't going to make any difference.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 

Author Comment

by:TKL1960
ID: 10866497
Hi Tim,
thanks for your very quick answer, which provided me the necessary background information to put this issue to bed. I optimized the sql and stopped digging in the other direction.
T.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now