Solved

Use of the Grid

Posted on 2002-03-29
8
256 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
  • 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

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
Colabnet Subversion - move repository 6 59
YouTube Friendly Video Addresses 3 87
graphic software 6 91
Google Maps 7 81
When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

828 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