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
Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

839 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