?
Solved

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

Posted on 2004-04-19
2
Medium Priority
?
2,012 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

762 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