Solved

Use of the Grid

Posted on 2002-03-29
8
260 Views
Last Modified: 2013-12-24
Hi,
   Can the grid be programmed to a recordset rather than from a data control ??

I would like to retrieve the data manually and then programatically add it to the grid.

Regards...

Peter.
0
Comment
Question by:annandap
[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
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:msdixon
ID: 6905801
a better way might be to modify your query so it only returns the rows you need. the approach above would take twice as long because you're going through the recordset once to remove unwanted items, then going through it again to display the data.

i don't use the DTC's in VI, and i don't recall how to do that, but i'll look into it.
0
 

Author Comment

by:annandap
ID: 6906257
Sorry I should have put the reason why I wanted to do this. The data I am returning comes from 3 different databases. One database is a program database that holds queries, forms etc the second is a reference or lookup database that holds full description of items and the data database holds the data and uses the reference database to provide description of codes stored in the data database.  Therefore I scan the data database to return records required and add them to an array, next I reference the lookup database to supply the description of the codes and update the array.

For example the data returned for an employee from the data database would have a location code of TAF01, lookinhg up the refence database would provide me with an address for that location which I would then replace in the array with the location address rather than the location code.
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6907346
i would suggest writing the code to iterate through the three recordsets without using a grid control. your code will be a lot cleaner than the generated code.

i'll try and get some time to look into this over the weekend...
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

Author Comment

by:annandap
ID: 6908373
The reason I wanted to use the grid is I'm not to happy with a plain table, I originally loaded all the data into arrays and then produced the table, also I like the look of the grid rather than the borders on the table.

Regards..

Peter.
0
 
LVL 9

Expert Comment

by:msdixon
ID: 6910179
i couldn't find a way to do this. there is no way to set the grid control to pull from more than one recordset, and the one recordset it can pull from needs to be designated through DTC's, not the code itself.

as far as appearance goes, the grid is just html. view the source, and that should give you an idea of what to change to make it look the same.
0
 

Author Comment

by:annandap
ID: 6911181
I have found another way to do this, there is a product called VbsDb (free) which is a series of ASP pages that load and format data from recordsets.

I will close off the question tomorrow.

Regards....

Peter.
0
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 6915480
You can also use the MsFlexGrid

<OBJECT classid=clsid:6262D3A0-531B-11CF-91F6-C2863C385E30
codeBase=http://activex.microsoft.com/controls/vb6/MSFlxGrd.cab id=MSFlexGrid1
style="HEIGHT: 133px; TOP: 0px; VISIBILITY: visible; WIDTH: 709px"><PARAM NAME="_ExtentX" VALUE="15007"><PARAM NAME="_ExtentY" VALUE="2815"><PARAM NAME="_Version" VALUE="393216"><PARAM NAME="Rows" VALUE="5000"><PARAM NAME="Cols" VALUE="6"><PARAM NAME="FixedRows" VALUE="1"><PARAM NAME="FixedCols" VALUE="5</OBJECT>

Then just insert the data example here for the column headers

GridRow = 0
 MSFlexGrid1.rows = GridRow + 1
 MSFlexGrid1.Row = GridRow
 MSFlexGrid1.Col = 0
 MSFlexGrid1.ColWidth(0) = 1500
 MSFlexGrid1.Text = "Item Code"
 MSFlexGrid1.Col = 1
 MSFlexGrid1.ColWidth(1) = 600
 MSFlexGrid1.Text = "Qty"
 MSFlexGrid1.Col = 2
 MSFlexGrid1.ColWidth(2) = 1500
 MSFlexGrid1.Text = "Price"
 MSFlexGrid1.Col = 3
 MSFlexGrid1.ColWidth(3) = 2000
 MSFlexGrid1.Text = "Start Date"
 MSFlexGrid1.Col = 4
 MSFlexGrid1.ColWidth(4) = 2000
 MSFlexGrid1.Text = "End Date"
 MSFlexGrid1.Col = 5
 MSFlexGrid1.ColWidth(5) = 675
 MSFlexGrid1.Text = "Delete"
0
 

Author Comment

by:annandap
ID: 6916578
Thanks, never even thought of trying that approach.

Regards
Peter..
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

688 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