Solved

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

Posted on 2004-04-19
2
2,005 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 84
fso.FolderExists("\\server\HiddenFolder$") 4 89
pop out of webbrowser1 control vba6 5 44
MS SQL Update query with connected table data 3 62
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

733 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