Solved

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

Posted on 2004-04-19
2
1,994 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

11 Experts available now in Live!

Get 1:1 Help Now